|
|||||||||
| 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(java.lang.String encoding)
|
| Method Summary | |
|---|---|
java.lang.String |
decode(byte[] encodedString)
Decode an array of bytes into a string. |
java.lang.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(java.lang.String s)
Encode a string to an array of bytes. |
static Encoding |
getDatabaseEncoding(java.lang.String databaseEncoding)
Construct an Encoding for a given database encoding. |
java.io.Reader |
getDecodingReader(java.io.InputStream in)
Get a Reader that decodes the given InputStream using this encoding. |
java.io.Writer |
getEncodingWriter(java.io.OutputStream out)
Get a Writer that encodes to the given OutputStream using this encoding. |
static Encoding |
getJVMEncoding(java.lang.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. |
java.lang.String |
name()
Get the name of the (JVM) encoding used. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Encoding(java.lang.String encoding)
| Method Detail |
|---|
public boolean hasAsciiNumbers()
public static Encoding getJVMEncoding(java.lang.String jvmEncoding)
jvmEncoding - the name of the JVM encoding
public static Encoding getDatabaseEncoding(java.lang.String databaseEncoding)
databaseEncoding - the name of the database encoding
public java.lang.String name()
public byte[] encode(java.lang.String s)
throws java.io.IOException
s - the string to encode
java.io.IOException - if something goes wrong
public java.lang.String decode(byte[] encodedString,
int offset,
int length)
throws java.io.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
java.io.IOException - if something goes wrong
public java.lang.String decode(byte[] encodedString)
throws java.io.IOException
encodedString - a bytearray containing the encoded string the string to encod
java.io.IOException - if something goes wrong
public java.io.Reader getDecodingReader(java.io.InputStream in)
throws java.io.IOException
in - the underlying stream to decode from
java.io.IOException - if something goes wrong
public java.io.Writer getEncodingWriter(java.io.OutputStream out)
throws java.io.IOException
out - the underlying stream to encode to
java.io.IOException - if something goes wrongpublic static Encoding defaultEncoding()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||