public class IndexableBinaryStringTools
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.nio.ByteBuffer |
decode(java.nio.CharBuffer input)
Decodes the given char sequence, which must have been encoded by
encode(java.nio.ByteBuffer) or
encode(java.nio.ByteBuffer, java.nio.CharBuffer) . |
static void |
decode(java.nio.CharBuffer input,
java.nio.ByteBuffer output)
Decodes the input char sequence into the output byte sequence.
|
static java.nio.CharBuffer |
encode(java.nio.ByteBuffer input)
Encodes the input byte sequence.
|
static void |
encode(java.nio.ByteBuffer input,
java.nio.CharBuffer output)
Encodes the input byte sequence into the output char sequence.
|
static int |
getDecodedLength(java.nio.CharBuffer encoded)
Returns the number of bytes required to decode the given char sequence.
|
static int |
getEncodedLength(java.nio.ByteBuffer original)
Returns the number of chars required to encode the given byte sequence.
|
public static int getEncodedLength(java.nio.ByteBuffer original) throws java.lang.IllegalArgumentException
original
- The byte sequence to be encoded. Must be backed by an array.java.lang.IllegalArgumentException
- If the given ByteBuffer is not backed by an arraypublic static int getDecodedLength(java.nio.CharBuffer encoded) throws java.lang.IllegalArgumentException
encoded
- The char sequence to be encoded. Must be backed by an array.java.lang.IllegalArgumentException
- If the given CharBuffer is not backed by an arraypublic static void encode(java.nio.ByteBuffer input, java.nio.CharBuffer output)
getEncodedLength(java.nio.ByteBuffer)
.input
- The byte sequence to encodeoutput
- Where the char sequence encoding result will go. The limit
is set to one past the position of the final char.java.lang.IllegalArgumentException
- If either the input or the output buffer
is not backed by an arraypublic static void decode(java.nio.CharBuffer input, java.nio.ByteBuffer output)
getDecodedLength(java.nio.CharBuffer)
.input
- The char sequence to decodeoutput
- Where the byte sequence decoding result will go. The limit
is set to one past the position of the final char.java.lang.IllegalArgumentException
- If either the input or the output buffer
is not backed by an arraypublic static java.nio.ByteBuffer decode(java.nio.CharBuffer input)
encode(java.nio.ByteBuffer)
or
encode(java.nio.ByteBuffer, java.nio.CharBuffer)
.input
- The char sequence to decodejava.lang.IllegalArgumentException
- If the input buffer is not backed by an
arraypublic static java.nio.CharBuffer encode(java.nio.ByteBuffer input)
input
- The byte sequence to encodejava.lang.IllegalArgumentException
- If the input buffer is not backed by an
arrayCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.