public abstract class ByteArrayEncoder extends Object
This class is an interface for new Encoders (e.g. Base58Encoder)
and a factory for such encoders.
| Constructor and Description |
|---|
ByteArrayEncoder() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
encode(byte[] data)
Encode the given byte array data into the encoding that is supported by the encoder.
|
static ByteArrayEncoder |
forEncoding(String encoding)
Return an encoder for the given encoding (e.g.
|
abstract boolean |
supports(String encoding)
For concrete encoders this method should return
true if the given encoding is supported. |
public abstract boolean supports(String encoding)
For concrete encoders this method should return true if the given encoding is supported.
encoding - the encoding to check for.true if the encoding is supported by the encoder.public abstract String encode(byte[] data)
Encode the given byte array data into the encoding that is supported by the encoder.
data - the data to encode.public static ByteArrayEncoder forEncoding(String encoding)
Return an encoder for the given encoding (e.g. base58).
encoding - the encoding for which an encoder should be created.null if no encoder is available.Copyright © 2020 sw4j.org. All rights reserved.