public static final class TextIO.ForCharset extends TextIO
TextIO
class that writes and reads text files
in encodings specified by their names (as the second argument of
InputStreamReader
and OutputStreamWriter
constructors).
You can create an instance of this class for any desired encoding by the
getInstance(String)
method or use one of the following constants declared
in TextIO
class:TextIO.ASCII
TextIO.CP1252
TextIO.ISO8859_1
TextIO.UNICODE_BIG
TextIO.UNICODE_BIG_UNMARKED
TextIO.UNICODE_LITTLE
TextIO.UNICODE_LITTLE_UNMARKED
TextIO.UTF16
TextIO.UTF8
TextIO.ForCharset, TextIO.SystemDefault
ASCII, CP1252, ISO8859_1, SYSTEM_DEFAULT, UNICODE_BIG, UNICODE_BIG_UNMARKED, UNICODE_LITTLE, UNICODE_LITTLE_UNMARKED, UTF16, UTF8
Modifier and Type | Method and Description |
---|---|
java.lang.String |
charsetName()
Returns the name of the encoding used by this instance.
|
boolean |
equals(java.lang.Object obj)
Determines whether or not two instances are equal.
|
static TextIO.ForCharset |
getInstance(java.lang.String charsetName)
Creates a new instance of this class that will write and read text files
in the encoding specified by
charsetName argument. |
int |
hashCode()
Returns the hash code for this instance.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
read, read, readChars, readChars, write, writeChars, writeCharsOrDelete, writeOrDelete
public java.lang.String charsetName()
java.io
and java.lang
API.
(java.nio
API uses another names: see
"supported
encodings" Sun's page for more details.)java.io
and java.lang
API)public static TextIO.ForCharset getInstance(java.lang.String charsetName) throws java.io.UnsupportedEncodingException
charsetName
argument.
charsetName
should be the canonical encoding name for
java.io
and java.lang
API.
(java.nio
API uses another names: see
"supported
encodings" Sun's page for more details.)charsetName
- canonical name of the encoding that will be used by new instancejava.io.UnsupportedEncodingException
- if the given encoding is not supportedpublic java.lang.String toString()
null
.toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
ForCharset
are equal if they
have equal encoding names.equals
in class java.lang.Object
obj
- an object to be compared with this Rect
true
if the object to be compared is an instance of
ForCharset
and has the same encoding name