Class Base58OutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.apache.commons.codec.binary.BaseNCodecOutputStream<Base58,Base58OutputStream,Base58OutputStream.Builder>
-
- org.apache.commons.codec.binary.Base58OutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class Base58OutputStream extends BaseNCodecOutputStream<Base58,Base58OutputStream,Base58OutputStream.Builder>
Provides Base58 encoding 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_LENGTHencoded bytes by default and throwsIOExceptionwhen an input chunk would exceed the cumulative limit. To configure the limit, pass a codec built withBase58.Builder.setMaxDecodeLength(int)to the stream builder'ssetBaseNCodec(Base58)method.Encoding accepts at most
Base58.DEFAULT_MAX_ENCODE_LENGTHbinary bytes by default and throwsIOExceptionwhen an input chunk would exceed that cumulative limit. Configure it withBase58.Builder.setMaxEncodeLength(int)on the codec passed tosetBaseNCodec(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:
Base58, The Base58 Encoding Scheme draft-msporny-base58-03
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBase58OutputStream.BuilderBuilds instances of Base58OutputStream.-
Nested classes/interfaces inherited from class org.apache.commons.codec.binary.BaseNCodecOutputStream
BaseNCodecOutputStream.AbstractBuilder<T,C extends BaseNCodec,B extends BaseNCodecOutputStream.AbstractBuilder<T,C,B>>
-
-
Constructor Summary
Constructors Constructor Description Base58OutputStream(java.io.OutputStream outputStream)Constructs a Base58OutputStream such that all data written is Base58-encoded to the original provided OutputStream.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Base58OutputStream.Builderbuilder()Constructs a new Builder.-
Methods inherited from class org.apache.commons.codec.binary.BaseNCodecOutputStream
close, eof, flush, isStrictDecoding, write, write
-
-
-
-
Constructor Detail
-
Base58OutputStream
public Base58OutputStream(java.io.OutputStream outputStream)
Constructs a Base58OutputStream such that all data written is Base58-encoded to the original provided OutputStream.- Parameters:
outputStream- OutputStream to wrap.
-
-
Method Detail
-
builder
public static Base58OutputStream.Builder builder()
Constructs a new Builder.- Returns:
- A new Builder.
-
-