Package org.firebirdsql.encodings
Interface Encoding
- 
 public interface EncodingEncoding translates between a Java string and a byte array for a specific (Firebird) encoding.Encoding implementations need to be thread-safe. 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.ReadercreateReader(java.io.InputStream inputStream)Creates a reader wrapping an input stream.java.io.WritercreateWriter(java.io.OutputStream outputStream)Creates a writer wrapping an input stream.java.lang.StringdecodeFromCharset(byte[] in)Decodes the supplied byte array to a String.java.lang.StringdecodeFromCharset(byte[] in, int offset, int length)Decodes a part of the supplied byte array to a String.byte[]encodeToCharset(java.lang.String in)Encodes the supplied String to bytes in this encoding.java.lang.StringgetCharsetName()
 
- 
- 
- 
Method Detail- 
encodeToCharsetbyte[] encodeToCharset(java.lang.String in) Encodes the supplied String to bytes in this encoding.- Parameters:
- in- String to encode
- Returns:
- Byte array with encoded string
 
 - 
decodeFromCharsetjava.lang.String decodeFromCharset(byte[] in) Decodes the supplied byte array to a String.- Parameters:
- in- byte array to decode
- Returns:
- String after decoding the byte array
 
 - 
decodeFromCharsetjava.lang.String decodeFromCharset(byte[] in, int offset, int length)Decodes a part of the supplied byte array to a String.- Parameters:
- in- byte array to decode
- offset- Offset into the byte array
- length- Length in bytes to decode
- Returns:
- String after decoding the byte array
 
 - 
getCharsetNamejava.lang.String getCharsetName() - Returns:
- The name of the Java character set.
 
 - 
createReaderjava.io.Reader createReader(java.io.InputStream inputStream) Creates a reader wrapping an input stream.- Parameters:
- inputStream- Input stream
- Returns:
- Reader applying this encoding when reading
 
 - 
createWriterjava.io.Writer createWriter(java.io.OutputStream outputStream) Creates a writer wrapping an input stream.- Parameters:
- outputStream- Input stream
- Returns:
- Writer applying this encoding when writing
 
 
- 
 
-