com.caucho.vfs.i18n
Class UTF16Writer
java.lang.Object
com.caucho.vfs.i18n.EncodingWriter
com.caucho.vfs.i18n.UTF16Writer
public class UTF16Writer
- extends EncodingWriter
Implements an encoding char-to-byte writer for UTF16 and the associated
factory.
Constructor Summary |
UTF16Writer()
Null-arg constructor for instantiation by com.caucho.vfs.Encoding only. |
Method Summary |
EncodingWriter |
create(java.lang.String javaEncoding)
Create a UTF-16 writer using on the WriteStream to send bytes. |
void |
write(ByteAppendable os,
char ch)
Writes the character using the correct encoding. |
void |
write(OutputStreamWithBuffer os,
char[] cbuf,
int off,
int len)
Writes a character buffer using the UTF-16 encoding. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UTF16Writer
public UTF16Writer()
- Null-arg constructor for instantiation by com.caucho.vfs.Encoding only.
create
public EncodingWriter create(java.lang.String javaEncoding)
- Create a UTF-16 writer using on the WriteStream to send bytes.
- Specified by:
create
in class EncodingWriter
- Parameters:
javaEncoding
- the JDK name for the encoding.
- Returns:
- the UTF-16 writer.
write
public void write(ByteAppendable os,
char ch)
throws java.io.IOException
- Writes the character using the correct encoding.
- Specified by:
write
in class EncodingWriter
ch
- the character to write
- Throws:
java.io.IOException
write
public void write(OutputStreamWithBuffer os,
char[] cbuf,
int off,
int len)
throws java.io.IOException
- Writes a character buffer using the UTF-16 encoding.
- Overrides:
write
in class EncodingWriter
- Parameters:
cbuf
- character array with the data to write.off
- starting offset into the character array.len
- the number of characters to write.
- Throws:
java.io.IOException