Class Base58InputStream

All Implemented Interfaces:
Closeable, AutoCloseable

Provides Base58 decoding through a stream interface.

The default behavior of Base58InputStream is to decode, and the default behavior of Base58OutputStream is to encode. The builder can select either behavior with setEncode(boolean).

Results are available only after EOF. Decoding accepts at most Base58.DEFAULT_MAX_DECODE_LENGTH encoded bytes by default and throws IOException when an input chunk would exceed the cumulative limit. To configure the limit, pass a codec built with Base58.Builder.setMaxDecodeLength(int) to the stream builder's setBaseNCodec(Base58) method.

Encoding accepts at most Base58.DEFAULT_MAX_ENCODE_LENGTH binary bytes by default and throws IOException when an input chunk would exceed that cumulative limit. Configure it with Base58.Builder.setMaxEncodeLength(int) on the codec passed to setBaseNCodec(Base58).

The complete input is retained until EOF. Memory usage is proportional to the accumulated input and conversion output. Configure both input limits appropriately for larger trusted values; encoded output can exceed the decode limit.

Since:
1.22.0
See Also:
  • Constructor Details

    • Base58InputStream

      public Base58InputStream(InputStream inputStream)
      Constructs a Base58InputStream such that all data read is Base58-decoded from the original provided InputStream.
      Parameters:
      inputStream - InputStream to wrap.
  • Method Details