public class ByteWrangler extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static 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.
|
| Constructor | Description |
|---|---|
ByteWrangler() |
| Modifier and Type | Method | Description |
|---|---|---|
static byte[] |
encodeText(String text) |
|
static void |
readProperties(Map<String,byte[]> properties,
byte[] textBytes) |
|
static String |
readUTF(byte[] data) |
Read data bytes as "UTF-8" to String.
|
static String |
readUTF(byte[] data,
int off,
int len) |
Read data bytes as "UTF-8" to String.
|
static byte[] |
textFromProperties(Map<String,?> props) |
|
static void |
writeUTF(OutputStream out,
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
public static final String CHARSET_NAME
public static void writeUTF(OutputStream out, String str) throws IOException
IOExceptionpublic static String readUTF(byte[] data, int off, int len)
public static void readProperties(Map<String,byte[]> properties, byte[] textBytes) throws Exception
Exceptionpublic static byte[] encodeText(String text) throws IOException
IOExceptionCopyright © 2002–2018 JmDNS. All rights reserved.