Class EncodedStringDecoder<STRING_LIKE_TYPE extends CharSequence>
java.lang.Object
com.illumon.iris.db.v2.sources.regioned.decoder.EncodedStringDecoder<STRING_LIKE_TYPE>
- All Implemented Interfaces:
ObjectDecoder<STRING_LIKE_TYPE>
public class EncodedStringDecoder<STRING_LIKE_TYPE extends CharSequence> extends Object implements ObjectDecoder<STRING_LIKE_TYPE>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description EncodedStringDecoder(com.fishlib.base.string.cache.StringCache<STRING_LIKE_TYPE> cache, com.fishlib.base.string.EncodingInfo encodingInfo)EncodedStringDecoder(Class<STRING_LIKE_TYPE> dataType, com.fishlib.base.string.EncodingInfo encodingInfo) -
Method Summary
Modifier and Type Method Description STRING_LIKE_TYPEdecode(byte[] data, int offset, int length)Decode an object from an array of bytes.intexpectedObjectWidth()What width byte array does this ObjectCodec expect to encode and decode?
-
Constructor Details
-
EncodedStringDecoder
public EncodedStringDecoder(Class<STRING_LIKE_TYPE> dataType, com.fishlib.base.string.EncodingInfo encodingInfo) -
EncodedStringDecoder
public EncodedStringDecoder(com.fishlib.base.string.cache.StringCache<STRING_LIKE_TYPE> cache, com.fishlib.base.string.EncodingInfo encodingInfo)
-
-
Method Details
-
expectedObjectWidth
public final int expectedObjectWidth()Description copied from interface:ObjectDecoderWhat width byte array does this ObjectCodec expect to encode and decode?- Specified by:
expectedObjectWidthin interfaceObjectDecoder<STRING_LIKE_TYPE extends CharSequence>- Returns:
- VARIABLE_WIDTH_SENTINEL if the codec must encode and decode variable width columns, otherwise the fixed size of byte array that must be decoded and encoded.
-
decode
Description copied from interface:ObjectDecoderDecode an object from an array of bytes.- Specified by:
decodein interfaceObjectDecoder<STRING_LIKE_TYPE extends CharSequence>- Parameters:
data- The input byte array containing bytes to decodeoffset- The offset into the byte array to start decoding fromlength- The length of the byte array to decode from, starting at the offset- Returns:
- The output object, possibly null
-