Class Base58InputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.commons.codec.binary.BaseNCodecInputStream<Base58,Base58InputStream,Base58InputStream.Builder>
-
- org.apache.commons.codec.binary.Base58InputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class Base58InputStream extends BaseNCodecInputStream<Base58,Base58InputStream,Base58InputStream.Builder>
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_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.
- 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 classBase58InputStream.BuilderBuilds instances of Base58InputStream.-
Nested classes/interfaces inherited from class org.apache.commons.codec.binary.BaseNCodecInputStream
BaseNCodecInputStream.AbstracBuilder<T,C extends BaseNCodec,B extends AbstractBaseNCodecStreamBuilder<T,C,B>>
-
-
Constructor Summary
Constructors Constructor Description Base58InputStream(java.io.InputStream inputStream)Constructs a Base58InputStream such that all data read is Base58-decoded from the original provided InputStream.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Base58InputStream.Builderbuilder()Constructs a new Builder.-
Methods inherited from class org.apache.commons.codec.binary.BaseNCodecInputStream
available, isStrictDecoding, mark, markSupported, read, read, reset, skip
-
-
-
-
Constructor Detail
-
Base58InputStream
public Base58InputStream(java.io.InputStream inputStream)
Constructs a Base58InputStream such that all data read is Base58-decoded from the original provided InputStream.- Parameters:
inputStream- InputStream to wrap.
-
-
Method Detail
-
builder
public static Base58InputStream.Builder builder()
Constructs a new Builder.- Returns:
- A new Builder.
-
-