private static class RubyEncoding.UTF8Coder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUF_SIZE
The resulting encode/decode buffer sized by the max number of
characters (using 4 bytes per char possible for utf-8)
|
private java.nio.ByteBuffer |
byteBuffer |
private static int |
CHAR_THRESHOLD
The maximum number of characters we can encode/decode in our cached buffers
|
private java.nio.CharBuffer |
charBuffer |
private java.nio.charset.CharsetDecoder |
decoder |
private java.nio.charset.CharsetEncoder |
encoder |
| Constructor and Description |
|---|
UTF8Coder() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
decode(byte[] bytes) |
java.lang.String |
decode(byte[] bytes,
int start,
int length) |
byte[] |
encode(java.lang.CharSequence cs) |
private final java.nio.charset.CharsetEncoder encoder
private final java.nio.charset.CharsetDecoder decoder
private static final int CHAR_THRESHOLD
private static final int BUF_SIZE
private final java.nio.ByteBuffer byteBuffer
private final java.nio.CharBuffer charBuffer