public class StringEncodingUtils extends Object
| Constructor and Description |
|---|
StringEncodingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
byteBufferToBytes(ByteBuffer buffer) |
static char[] |
bytesToCharArrayUTFNIO(byte[] buffer)
Always returns a copy of the data as a char[]
|
static byte[] |
charArrayToBytesUTFNIO(char[] buffer) |
static char[] |
charBufferToChars(CharBuffer buffer) |
static void |
eraseByteBuffer(ByteBuffer buffer) |
static void |
eraseCharBuffer(CharBuffer buffer) |
static byte[] |
stringAsUTF8ByteArray(String str) |
public static String ENCODING
public static byte[] charArrayToBytesUTFNIO(char[] buffer)
public static char[] bytesToCharArrayUTFNIO(byte[] buffer)
buffer - buffer to decode into UTF-8 characterspublic static byte[] byteBufferToBytes(ByteBuffer buffer)
buffer - the buffer to convertpublic static char[] charBufferToChars(CharBuffer buffer)
buffer - the buffer to convertpublic static void eraseCharBuffer(CharBuffer buffer)
public static void eraseByteBuffer(ByteBuffer buffer)
public static byte[] stringAsUTF8ByteArray(String str)
Copyright © 2018. All rights reserved.