public class ByteWrangler extends Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
ByteWrangler() |
| Modifier and Type | Method and 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 a String.
|
static String |
readUTF(byte[] data,
int off,
int len)
Read data bytes as UTF-8 to a String.
|
static byte[] |
textFromProperties(Map<String,?> props) |
static void |
writeUTF(OutputStream out,
String str)
Write a UTF string with a length 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 void writeUTF(OutputStream out, String str) throws IOException
IOExceptionpublic static String readUTF(byte[] data)
public 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–2017 JmDNS. All rights reserved.