summaryrefslogtreecommitdiff
path: root/gnu/java/nio/charset/UTF_16.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2002-11-08 12:15:32 +0000
committerMichael Koch <konqueror@gmx.de>2002-11-08 12:15:32 +0000
commit03e7fa338ecf4ad04592db8ac84e175646416213 (patch)
tree672c51dbc3e6331a6ee29c1dedb7031495f3436b /gnu/java/nio/charset/UTF_16.java
parent607c7096d2fe8bef1455b837ccb8d4ed7ae2e083 (diff)
downloadclasspath-03e7fa338ecf4ad04592db8ac84e175646416213.tar.gz
2002-11-08 Jesse Rosenstock <jmr@fulcrummicro.com>
* java/nio/charset/CharacterCodingException.java: This class must be public. * java/nio/charset/Charset.java: Implemented whole class. * java/nio/charset/CharsetDecoder.java: Implemented whole class. * java/nio/charset/CharsetEncoder.java: Implemented whole class. * java/nio/charset/CoderMalfunctionError.java: This class must be public. * java/nio/charset/CoderResult.java: Implemented whole class. * java/nio/charset/CodingErrorAction.java: This class must be public. * java/nio/charset/IllegalCharsetNameException.java: This class must be public, better implementation. * java/nio/charset/MalformedInputException.java: This class must be public, better implementation. * java/nio/charset/UnmappableCharacterException.java: This class must be public, better implementation. * java/nio/charset/UnsupportedCharsetException.java: This class must be public, better implementation. * gnu/java/nio/charset/ISO_8859_1.java, gnu/java/nio/charset/Provider.java, gnu/java/nio/charset/US_ASCII.java, gnu/java/nio/charset/UTF_16.java, gnu/java/nio/charset/UTF_16BE.java, gnu/java/nio/charset/UTF_16Decoder.java, gnu/java/nio/charset/UTF_16Encoder.java, gnu/java/nio/charset/UTF_16LE.java, gnu/java/nio/charset/UTF_8.java, gnu/java/nio/charset/Makefile.am, gnu/java/nio/charset/.cvsignore: New files. * gnu/java/nio/Makefile.am: Add new subdir charset. * configure.in: Added gnu/java/nio/charset/Makefile to AC_OUTPUT.
Diffstat (limited to 'gnu/java/nio/charset/UTF_16.java')
-rw-r--r--gnu/java/nio/charset/UTF_16.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/java/nio/charset/UTF_16.java b/gnu/java/nio/charset/UTF_16.java
new file mode 100644
index 000000000..4d7105c8f
--- /dev/null
+++ b/gnu/java/nio/charset/UTF_16.java
@@ -0,0 +1,38 @@
+package gnu.java.nio.charset;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
+
+/**
+ * UTF-16 charset.
+ *
+ * @author Jesse Rosenstock
+ */
+final class UTF_16 extends Charset
+{
+ UTF_16 ()
+ {
+ super ("UTF-16", null);
+ }
+
+ public boolean contains (Charset cs)
+ {
+ return cs instanceof US_ASCII || cs instanceof ISO_8859_1
+ || cs instanceof UTF_8 || cs instanceof UTF_16BE
+ || cs instanceof UTF_16LE || cs instanceof UTF_16;
+ }
+
+ public CharsetDecoder newDecoder ()
+ {
+ return new UTF_16Decoder (this, UTF_16Decoder.UNKNOWN_ENDIAN);
+ }
+
+ public CharsetEncoder newEncoder ()
+ {
+ return new UTF_16Encoder (this, UTF_16Encoder.BIG_ENDIAN, false);
+ }
+}