what-the-bank/sources/org/bouncycastle/asn1/BEROutputStream.java

29 lines
813 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.asn1;
import java.io.IOException;
import java.io.OutputStream;
/* loaded from: classes6.dex */
public class BEROutputStream extends DEROutputStream {
public void writeObject(Object obj) throws IOException {
ASN1Primitive aSN1Primitive;
if (obj == null) {
writeNull();
return;
}
if (obj instanceof ASN1Primitive) {
aSN1Primitive = (ASN1Primitive) obj;
} else {
if (!(obj instanceof ASN1Encodable)) {
throw new IOException("object not BEREncodable");
}
aSN1Primitive = ((ASN1Encodable) obj).toASN1Primitive();
}
aSN1Primitive.encode(this);
}
public BEROutputStream(OutputStream outputStream) {
super(outputStream);
}
}