- 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)Stringencode(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 rawBaseencoder.format- theBaseFormatto apply.
-
-
Method Detail
-
encode
public String encode(byte[] data)
- Specified by:
encodein interfaceBinaryCodec- Parameters:
data- the binary data to encode.- Returns:
- the given
dataencoded asString.
-
decode
public byte[] decode(String encodedData)
- Specified by:
decodein interfaceBinaryCodec- Parameters:
encodedData- theencodedString.- Returns:
- the decoded data as
bytearray.
-
-