Package org.apache.jena.atlas.io
Class OutStreamUTF8
- java.lang.Object
-
- java.io.Writer
-
- org.apache.jena.atlas.io.OutStreamUTF8
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable
public final class OutStreamUTF8 extends java.io.WriterOutput UTF-8 encoded data. This class implements the "Modified UTF8" encoding rules (null -> C0 80) It will encode any 16 bit value. It can be used as a pure UTF-8 encoder.- See Also:
InStreamUTF8
-
-
Constructor Summary
Constructors Constructor Description OutStreamUTF8(java.io.OutputStream out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static byte[]encode(int ch)Return a byte array with the UTF-8 encoding of the integervoidflush()voidoutput(int x)static voidoutput(java.io.OutputStream out, int ch)voidwrite(char[] b)voidwrite(char[] cbuf, int off, int len)voidwrite(int ch)voidwrite(java.lang.String str)voidwrite(java.lang.String str, int idx, int len)
-
-
-
Method Detail
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException- Specified by:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(int ch) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(char[] b) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(java.lang.String str) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int idx, int len) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
output
public void output(int x)
-
encode
public static byte[] encode(int ch)
Return a byte array with the UTF-8 encoding of the integer
-
output
public static void output(java.io.OutputStream out, int ch) throws java.io.IOException- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classjava.io.Writer- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Writer- Throws:
java.io.IOException
-
-