com.caucho.vfs.i18n
Class UTF8Writer

java.lang.Object
  extended by com.caucho.vfs.i18n.EncodingWriter
      extended by com.caucho.vfs.i18n.UTF8Writer

public class UTF8Writer
extends EncodingWriter

Implements an encoding char-to-byte writer for UTF8 and the associated factory.


Field Summary
 
Fields inherited from class com.caucho.vfs.i18n.EncodingWriter
log
 
Constructor Summary
UTF8Writer()
          Null-arg constructor for instantiation by com.caucho.vfs.Encoding only.
 
Method Summary
 EncodingWriter create()
          Returns the UTF8_Writer
 EncodingWriter create(java.lang.String javaEncoding)
          Returns the UTF8_Writer
 java.lang.String getJavaEncoding()
          Returns the Java encoding for the writer.
 void write(ByteAppendable os, char ch)
          Writes a character to the output stream with the correct encoding.
 void write(OutputStreamWithBuffer os, char[] cbuf, int off, int len)
          Writes into a character buffer using the correct encoding.
 
Methods inherited from class com.caucho.vfs.i18n.EncodingWriter
setJavaEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UTF8Writer

public UTF8Writer()
Null-arg constructor for instantiation by com.caucho.vfs.Encoding only.

Method Detail

getJavaEncoding

public java.lang.String getJavaEncoding()
Returns the Java encoding for the writer.

Overrides:
getJavaEncoding in class EncodingWriter

create

public EncodingWriter create(java.lang.String javaEncoding)
Returns the UTF8_Writer

Specified by:
create in class EncodingWriter
Parameters:
javaEncoding - the JDK name for the encoding.
Returns:
the UTF8_Writer

create

public EncodingWriter create()
Returns the UTF8_Writer

Overrides:
create in class EncodingWriter
Returns:
the UTF8_Writer

write

public void write(ByteAppendable os,
                  char ch)
           throws java.io.IOException
Writes a character to the output stream with the correct encoding.

Specified by:
write in class EncodingWriter
Parameters:
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 into a character buffer using the correct 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