- java.lang.Object
-
- io.github.mmm.binary.codec.BaseFormatCodec
-
- All Implemented Interfaces:
BinaryCodec
public class BaseFormatCodec extends Object implements BinaryCodec
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description BaseFormatCodec(Base base, BaseFormat format)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decode(String encodedData)
String
encode(byte[] data)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.binary.codec.BinaryCodec
decodeInt, decodeLong, decodeShort, encodeInt, encodeLong, encodeShort
-
-
-
-
Constructor Detail
-
BaseFormatCodec
public BaseFormatCodec(Base base, BaseFormat format)
The constructor.- Parameters:
base
- the rawBase
encoder.format
- theBaseFormat
to apply.
-
-
Method Detail
-
encode
public String encode(byte[] data)
- Specified by:
encode
in interfaceBinaryCodec
- Parameters:
data
- the binary data to encode.- Returns:
- the given
data
encoded asString
.
-
decode
public byte[] decode(String encodedData)
- Specified by:
decode
in interfaceBinaryCodec
- Parameters:
encodedData
- theencoded
String
.- Returns:
- the decoded data as
byte
array.
-
-