decode
public java.lang.String decode(byte[] data,
int offset,
int length)
throws java.io.IOException
Custom byte[] -> String conversion routine for UTF-8 only. This is about twice as fast as using
the String(byte[],int,int,String) ctor, at least under JDK 1.4.2. The extra checks for illegal
representations add about 10-15% overhead, but they seem worth it given the number of SQL_ASCII
databases out there.
- Overrides:
decode
in class Encoding
- Parameters:
data
- the array containing UTF8-encoded data
offset
- the offset of the first byte in data
to decode from
length
- the number of bytes to decode
- Returns:
- a decoded string
- Throws:
java.io.IOException
- if something goes wrong