|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.util.binary.UTF8
public class UTF8
Utils for handling Standard-UTF8 and Modified-UTF8 Strings.
The differences between standard UTF8 and Modified are the following:
'\u0000'
is encoded in 2-byte format
rather than 1-byte, so that the encoded strings never have
embedded nulls.
Field Summary | |
---|---|
static java.nio.charset.Charset |
CHARSET
|
Constructor Summary | |
---|---|
UTF8()
|
Method Summary | |
---|---|
static int |
getModifiedUTF8EncodingByteLength(java.lang.String str)
Get the number of bytes in an Modified-UTF-8 encoding of a string |
static int |
getUTF8EncodingByteLength(java.lang.String string)
Get the number of bytes in an UTF-8 encoding of a string |
static java.lang.String |
readModifiedUTF(java.io.DataInput in,
int utflen)
Read Modified-UTF8 from a stream |
static java.lang.String |
readUTF(java.io.DataInput in,
int len)
Read Standard-UTF8 from a stream |
static void |
writeModifiedUTF(java.io.DataOutput out,
java.lang.String str)
Write Modified-UTF8 to a stream. |
static void |
writeUTF(java.io.DataOutput out,
java.lang.String str)
Write Standard-UTF8 to a stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.nio.charset.Charset CHARSET
Constructor Detail |
---|
public UTF8()
Method Detail |
---|
public static int getUTF8EncodingByteLength(java.lang.String string)
string
-
public static int getModifiedUTF8EncodingByteLength(java.lang.String str)
str
-
public static void writeModifiedUTF(java.io.DataOutput out, java.lang.String str) throws java.io.IOException
out
- output streamstr
- string
java.io.IOException
public static java.lang.String readModifiedUTF(java.io.DataInput in, int utflen) throws java.io.IOException, java.io.UTFDataFormatException
in
- inpututflen
- number of bytes
java.io.IOException
java.io.UTFDataFormatException
public static void writeUTF(java.io.DataOutput out, java.lang.String str) throws java.io.IOException
str
- out
-
java.io.IOException
public static java.lang.String readUTF(java.io.DataInput in, int len) throws java.io.IOException
in
- inputlen
- number of bytes
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |