Class Base16OutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class Base16OutputStream
    extends BaseNCodecOutputStream
    Provides Hex encoding and decoding in a streaming fashion (unlimited size).

    The default behavior of the HexOutputStream is to ENCODE, whereas the default behavior of the Base16InputStream is to DECODE. But this behavior can be overridden by using a different constructor.

    Since:
    1.15
    • Constructor Summary

      Constructors 
      Constructor Description
      Base16OutputStream​(java.io.OutputStream out)
      Creates a Base16OutputStream such that all data written is Hex-encoded to the original provided OutputStream.
      Base16OutputStream​(java.io.OutputStream out, boolean doEncode)
      Creates a Base16OutputStream such that all data written is either Hex-encoded or Hex-decoded to the original provided OutputStream.
      Base16OutputStream​(java.io.OutputStream out, boolean doEncode, boolean lowerCase)
      Creates a Base16OutputStream such that all data written is either Hex-encoded or Hex-decoded to the original provided OutputStream.
      Base16OutputStream​(java.io.OutputStream out, boolean doEncode, boolean lowerCase, CodecPolicy decodingPolicy)
      Creates a Base16OutputStream such that all data written is either Hex-encoded or Hex-decoded to the original provided OutputStream.
    • Method Summary

      • Methods inherited from class java.io.FilterOutputStream

        write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Base16OutputStream

        public Base16OutputStream​(java.io.OutputStream out)
        Creates a Base16OutputStream such that all data written is Hex-encoded to the original provided OutputStream.
        Parameters:
        out - OutputStream to wrap.
      • Base16OutputStream

        public Base16OutputStream​(java.io.OutputStream out,
                                  boolean doEncode)
        Creates a Base16OutputStream such that all data written is either Hex-encoded or Hex-decoded to the original provided OutputStream.
        Parameters:
        out - OutputStream to wrap.
        doEncode - true if we should encode all data written to us, false if we should decode.
      • Base16OutputStream

        public Base16OutputStream​(java.io.OutputStream out,
                                  boolean doEncode,
                                  boolean lowerCase)
        Creates a Base16OutputStream such that all data written is either Hex-encoded or Hex-decoded to the original provided OutputStream.
        Parameters:
        out - OutputStream to wrap.
        doEncode - true if we should encode all data written to us, false if we should decode.
        lowerCase - if true then use a lower-case Base16 alphabet.
      • Base16OutputStream

        public Base16OutputStream​(java.io.OutputStream out,
                                  boolean doEncode,
                                  boolean lowerCase,
                                  CodecPolicy decodingPolicy)
        Creates a Base16OutputStream such that all data written is either Hex-encoded or Hex-decoded to the original provided OutputStream.
        Parameters:
        out - OutputStream to wrap.
        doEncode - true if we should encode all data written to us, false if we should decode.
        lowerCase - if true then use a lower-case Base16 alphabet.
        decodingPolicy - Decoding policy.