|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.postgresql.core.Encoding
public class Encoding
Representation of a particular character encoding.
| Constructor Summary | |
|---|---|
protected |
Encoding(String encoding)
|
| Method Summary | |
|---|---|
String |
decode(byte[] encodedString)
Decode an array of bytes into a string. |
String |
decode(byte[] encodedString,
int offset,
int length)
Decode an array of bytes into a string. |
static Encoding |
defaultEncoding()
Get an Encoding using the default encoding for the JVM. |
byte[] |
encode(String s)
Encode a string to an array of bytes. |
static Encoding |
getDatabaseEncoding(String databaseEncoding)
Construct an Encoding for a given database encoding. |
Reader |
getDecodingReader(InputStream in)
Get a Reader that decodes the given InputStream using this encoding. |
Writer |
getEncodingWriter(OutputStream out)
Get a Writer that encodes to the given OutputStream using this encoding. |
static Encoding |
getJVMEncoding(String jvmEncoding)
Construct an Encoding for a given JVM encoding. |
boolean |
hasAsciiNumbers()
Returns true if this encoding has characters '-' and '0'..'9' in exactly same posision as ascii. |
String |
name()
Get the name of the (JVM) encoding used. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Encoding(String encoding)
| Method Detail |
|---|
public boolean hasAsciiNumbers()
public static Encoding getJVMEncoding(String jvmEncoding)
jvmEncoding - the name of the JVM encoding
public static Encoding getDatabaseEncoding(String databaseEncoding)
databaseEncoding - the name of the database encoding
public String name()
public byte[] encode(String s)
throws IOException
s - the string to encode
IOException - if something goes wrong
public String decode(byte[] encodedString,
int offset,
int length)
throws IOException
encodedString - a bytearray containing the encoded string the string to encodoffset - the offset in encodedString of the first byte of the encoded
representationlength - the length, in bytes, of the encoded representation
IOException - if something goes wrong
public String decode(byte[] encodedString)
throws IOException
encodedString - a bytearray containing the encoded string the string to encod
IOException - if something goes wrong
public Reader getDecodingReader(InputStream in)
throws IOException
in - the underlying stream to decode from
IOException - if something goes wrong
public Writer getEncodingWriter(OutputStream out)
throws IOException
out - the underlying stream to encode to
IOException - if something goes wrongpublic static Encoding defaultEncoding()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||