public class ByteWrangler
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
CHARSET_NAME
Name for charset used to convert Strings to/from wire bytes: "UTF-8".
|
static byte[] |
EMPTY_TXT
Representation of empty text.
|
static int |
MAX_DATA_LENGTH
Maximum number of bytes record data can consist of.
|
static int |
MAX_VALUE_LENGTH
Maximum number of bytes a value can consist of.
|
static byte[] |
NO_VALUE
Representation of no value.
|
| 构造器和说明 |
|---|
ByteWrangler() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
encodeText(java.lang.String text) |
static void |
readProperties(java.util.Map<java.lang.String,byte[]> properties,
byte[] textBytes) |
static java.lang.String |
readUTF(byte[] data)
Read data bytes as "UTF-8" to String.
|
static java.lang.String |
readUTF(byte[] data,
int off,
int len)
Read data bytes as "UTF-8" to String.
|
static byte[] |
textFromProperties(java.util.Map<java.lang.String,?> props) |
static void |
writeUTF(java.io.OutputStream out,
java.lang.String str)
Write a String as "UTF-8" encoded bytes to a stream.
|
public static final int MAX_VALUE_LENGTH
public static final int MAX_DATA_LENGTH
MAX_VALUE_LENGTH + 1 because the first byte contains the number of the following bytes.public static final byte[] NO_VALUE
public static final byte[] EMPTY_TXT
FIXME: Should this be exported as a method since it could change externally???
public static final java.lang.String CHARSET_NAME
public static void writeUTF(java.io.OutputStream out,
java.lang.String str)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readUTF(byte[] data)
public static java.lang.String readUTF(byte[] data,
int off,
int len)
public static void readProperties(java.util.Map<java.lang.String,byte[]> properties,
byte[] textBytes)
throws java.lang.Exception
java.lang.Exceptionpublic static byte[] textFromProperties(java.util.Map<java.lang.String,?> props)
public static byte[] encodeText(java.lang.String text)
throws java.io.IOException
java.io.IOException