Class BEROctetStringGenerator


  • public class BEROctetStringGenerator
    extends BERGenerator
    A generator for indefinite-length OCTET STRINGs
    • Constructor Detail

      • BEROctetStringGenerator

        public BEROctetStringGenerator​(OutputStream out)
                                throws IOException
        Use the passed in stream as the target for the generator, writing out the header tag for a constructed OCTET STRING.
        Parameters:
        out - target stream
        Throws:
        IOException - if the target stream cannot be written to.
      • BEROctetStringGenerator

        public BEROctetStringGenerator​(OutputStream out,
                                       int tagNo,
                                       boolean isExplicit)
                                throws IOException
        Use the passed in stream as the target for the generator, writing out the header tag for a tagged constructed OCTET STRING (possibly implicit).
        Parameters:
        out - target stream
        tagNo - the tag number to introduce
        isExplicit - true if this is an explicitly tagged object, false otherwise.
        Throws:
        IOException - if the target stream cannot be written to.
    • Method Detail

      • getOctetOutputStream

        public OutputStream getOctetOutputStream()
        Return a stream representing the content target for this OCTET STRING
        Returns:
        an OutputStream which chunks data in blocks of 1000 (CER limit).
      • getOctetOutputStream

        public OutputStream getOctetOutputStream​(byte[] buf)
        Return a stream representing the content target for this OCTET STRING
        Parameters:
        buf - the buffer to use for chunking the data.
        Returns:
        an OutputStream which chunks data in blocks of buf length.