public class DLSequenceGenerator extends DLGenerator
getRawOutputStream()
/ addObject(ASN1Encodable). close() verifies the body
came out at exactly the promised length and throws an IOException
otherwise — by then the output is not usable, but every length mismatch is
a caller arithmetic bug that must not pass silently.
Unlike DERSequenceGenerator nothing is buffered, so the body may
exceed the size of a Java array; the trade-off is that the length has to be
known before any content is produced.
_out| Constructor and Description |
|---|
DLSequenceGenerator(java.io.OutputStream out,
int tagNo,
boolean isExplicit,
long bodyLength)
Use the passed in stream as the target for the generator, writing out
the header for a tagged definite-length constructed SEQUENCE (possibly
implicit).
|
DLSequenceGenerator(java.io.OutputStream out,
long bodyLength)
Use the passed in stream as the target for the generator, writing out
the header for a definite-length constructed SEQUENCE.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addObject(ASN1Encodable object)
Add the DL encoding of the passed in object to the SEQUENCE body.
|
void |
close()
Verify the declared body length was written in full.
|
java.io.OutputStream |
getRawOutputStream()
Return the target stream for the SEQUENCE body.
|
getDLEncodingLength, getLengthOctetCount, writeDLHeaderpublic DLSequenceGenerator(java.io.OutputStream out,
long bodyLength)
throws java.io.IOException
out - target streambodyLength - the exact number of content octets that will be writtenjava.io.IOException - if the target stream cannot be written to.public DLSequenceGenerator(java.io.OutputStream out,
int tagNo,
boolean isExplicit,
long bodyLength)
throws java.io.IOException
out - target streamtagNo - the tag number to introduceisExplicit - true if this is an explicitly tagged object, false otherwise.bodyLength - the exact number of content octets that will be writtenjava.io.IOException - if the target stream cannot be written to.public java.io.OutputStream getRawOutputStream()
getRawOutputStream in class DLGeneratorpublic void addObject(ASN1Encodable object) throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOException - if fewer content octets were written than declared.