public class Utf8StringCodec extends RedisCodec<java.lang.String,java.lang.String>
RedisCodec that handles UTF-8 encoded keys and values.| Modifier and Type | Field and Description |
|---|---|
private java.nio.CharBuffer |
chars |
private java.nio.charset.Charset |
charset |
private java.nio.charset.CharsetDecoder |
decoder |
| Constructor and Description |
|---|
Utf8StringCodec()
Initialize a new instance that encodes and decodes strings using
the UTF-8 charset;
|
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
decode(java.nio.ByteBuffer bytes) |
java.lang.String |
decodeKey(java.nio.ByteBuffer bytes)
Decode the key output by redis.
|
java.lang.String |
decodeValue(java.nio.ByteBuffer bytes)
Decode the value output by redis.
|
private byte[] |
encode(java.lang.String string) |
byte[] |
encodeKey(java.lang.String key)
Encode the key for output to redis.
|
byte[] |
encodeValue(java.lang.String value)
Encode the value for output to redis.
|
private java.nio.charset.Charset charset
private java.nio.charset.CharsetDecoder decoder
private java.nio.CharBuffer chars
public Utf8StringCodec()
public java.lang.String decodeKey(java.nio.ByteBuffer bytes)
RedisCodecdecodeKey in class RedisCodec<java.lang.String,java.lang.String>bytes - Raw bytes of the key.public java.lang.String decodeValue(java.nio.ByteBuffer bytes)
RedisCodecdecodeValue in class RedisCodec<java.lang.String,java.lang.String>bytes - Raw bytes of the value.public byte[] encodeKey(java.lang.String key)
RedisCodecencodeKey in class RedisCodec<java.lang.String,java.lang.String>key - Key.public byte[] encodeValue(java.lang.String value)
RedisCodecencodeValue in class RedisCodec<java.lang.String,java.lang.String>value - Value.private java.lang.String decode(java.nio.ByteBuffer bytes)
private byte[] encode(java.lang.String string)