Package org.postgresql.core
Class CharOptimizedUTF8Encoder
- java.lang.Object
-
- org.postgresql.core.Encoding
-
- org.postgresql.core.OptimizedUTF8Encoder
-
- org.postgresql.core.CharOptimizedUTF8Encoder
-
final class CharOptimizedUTF8Encoder extends OptimizedUTF8Encoder
UTF-8 encoder which validates input and is optimized for jdk 8 and lower whereString
objects are backed bychar[]
.
-
-
Field Summary
-
Fields inherited from class org.postgresql.core.OptimizedUTF8Encoder
UTF_8_CHARSET
-
-
Constructor Summary
Constructors Constructor Description CharOptimizedUTF8Encoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
decode(byte[] encodedString, int offset, int length)
Decode an array of bytes into a string.-
Methods inherited from class org.postgresql.core.OptimizedUTF8Encoder
charDecode, decodeToChars, getCharArray
-
Methods inherited from class org.postgresql.core.Encoding
decode, defaultEncoding, encode, getDatabaseEncoding, getDecodingReader, getEncodingWriter, getJVMEncoding, hasAsciiNumbers, name, toString
-
-
-
-
Method Detail
-
decode
public java.lang.String decode(byte[] encodedString, int offset, int length) throws java.io.IOException
Decode an array of bytes into a string.- Overrides:
decode
in classEncoding
- Parameters:
encodedString
- a byte array containing the string to decodeoffset
- the offset inencodedString
of the first byte of the encoded representationlength
- the length, in bytes, of the encoded representation- Returns:
- the decoded string
- Throws:
java.io.IOException
- if something goes wrong
-
-