Class Base58OutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
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.
Close the output stream or call BaseNCodecOutputStream.eof() after the last write to complete conversion.
- Since:
- 1.22.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilds instances of Base58OutputStream.Nested classes/interfaces inherited from class BaseNCodecOutputStream
BaseNCodecOutputStream.AbstractBuilder<T,C, B> -
Field Summary
Fields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionBase58OutputStream(OutputStream outputStream) Constructs a Base58OutputStream such that all data written is Base58-encoded to the original provided OutputStream. -
Method Summary
Modifier and TypeMethodDescriptionstatic Base58OutputStream.Builderbuilder()Constructs a new Builder.Methods inherited from class BaseNCodecOutputStream
close, eof, flush, isStrictDecoding, write, writeMethods inherited from class FilterOutputStream
write
-
Constructor Details
-
Base58OutputStream
Constructs a Base58OutputStream such that all data written is Base58-encoded to the original provided OutputStream.- Parameters:
outputStream- OutputStream to wrap.
-
-
Method Details
-
builder
Constructs a new Builder.- Returns:
- A new Builder.
-