Home All Groups
commons-codec / org / apache / commons / codec / binary / BaseNCodecOutputStream.html /
org.apache.commons.codec.binary

Class BaseNCodecOutputStream

    • Constructor Detail

      • BaseNCodecOutputStream

        public BaseNCodecOutputStream(OutputStream output,
                                      BaseNCodec basedCodec,
                                      boolean doEncode)
        TODO should this be protected?
        Parameters:
        output - the underlying output or null.
        basedCodec - a BaseNCodec.
        doEncode - true to encode, false to decode, TODO should be an enum?
    • Method Detail

      • eof

        public void eof()
                 throws IOException
        Writes EOF.
        Throws:
        IOException - if an I/O error occurs.
        Since:
        1.11
      • isStrictDecoding

        public boolean isStrictDecoding()
        Returns true if decoding behavior is strict. Decoding will raise an IllegalArgumentException if trailing bits are not part of a valid encoding.

        The default is false for lenient encoding. Decoding will compose trailing bits into 8-bit bytes and discard the remainder.

        Returns:
        true if using strict decoding
        Since:
        1.15
      • write

        public void write(byte[] array,
                          int offset,
                          int len)
                   throws IOException
        Writes len bytes from the specified b array starting at offset to this output stream.
        Overrides:
        write in class  FilterOutputStream
        Parameters:
        array - source byte array
        offset - where to start reading the bytes
        len - maximum number of bytes to write
        Throws:
        IOException - if an I/O error occurs.
        NullPointerException - if the byte array parameter is null
        IndexOutOfBoundsException - if offset, len or buffer size are invalid

Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.