public abstract class BaseSerializingTranscoder extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
charset |
protected int |
compressionThreshold |
protected CompressionMode |
compressMode |
static String |
DEFAULT_CHARSET |
static int |
DEFAULT_COMPRESSION_THRESHOLD
Default compression threshold value.
|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
BaseSerializingTranscoder() |
Modifier and Type | Method and Description |
---|---|
byte[] |
compress(byte[] in)
Compress the given array of bytes.
|
protected String |
decodeString(byte[] data)
Decode the string with the current character set.
|
protected byte[] |
decompress(byte[] in)
Decompress the given array of bytes.
|
protected Object |
deserialize(byte[] in)
Get the object represented by the given serialized bytes.
|
protected byte[] |
encodeString(String in)
Encode a string into the current character set.
|
CompressionMode |
getCompressMode() |
protected byte[] |
serialize(Object o)
Get the bytes representing the given serialized object.
|
void |
setCharset(String to)
Set the character set for string value transcoding (defaults to UTF-8).
|
void |
setCompressionMode(CompressionMode compressMode) |
void |
setCompressionThreshold(int to)
Set the compression threshold to the given number of bytes.
|
public static final int DEFAULT_COMPRESSION_THRESHOLD
public static final String DEFAULT_CHARSET
protected int compressionThreshold
protected String charset
protected CompressionMode compressMode
protected static final org.slf4j.Logger log
public void setCompressionThreshold(int to)
to
- the number of bytespublic CompressionMode getCompressMode()
public void setCompressionMode(CompressionMode compressMode)
public void setCharset(String to)
protected byte[] serialize(Object o)
protected Object deserialize(byte[] in)
public final byte[] compress(byte[] in)
protected byte[] decompress(byte[] in)
protected String decodeString(byte[] data)
protected byte[] encodeString(String in)
Copyright © 2021. All rights reserved.