Package org.apache.jena.atlas.io
Class InStreamUTF8
- java.lang.Object
-
- java.io.Reader
-
- org.apache.jena.atlas.io.InStreamUTF8
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable,CharStream
public final class InStreamUTF8 extends java.io.Reader implements CharStream
Fast and streaming UTF-8
-
-
Constructor Summary
Constructors Constructor Description InStreamUTF8(java.io.InputStream in)InStreamUTF8(InputStreamBuffered in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intadvance()Next codepoint, given the first byte of any UTF-8 byte sequence is already known.static intadvance(InputStreamBuffered input)Next codepointvoidclose()voidcloseStream()Close the stream - different name from java.io.Reader.closestatic java.lang.Stringdecode(byte[] bytes)intread()intread(char[] cbuf, int off, int len)booleanready()
-
-
-
Constructor Detail
-
InStreamUTF8
public InStreamUTF8(java.io.InputStream in)
-
InStreamUTF8
public InStreamUTF8(InputStreamBuffered in)
-
-
Method Detail
-
ready
public boolean ready() throws java.io.IOException- Overrides:
readyin classjava.io.Reader- 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.Reader- Throws:
java.io.IOException
-
closeStream
public void closeStream()
Description copied from interface:CharStreamClose the stream - different name from java.io.Reader.close- Specified by:
closeStreamin interfaceCharStream
-
read
public int read(char[] cbuf, int off, int len)- Specified by:
readin classjava.io.Reader
-
read
public final int read()
- Overrides:
readin classjava.io.Reader
-
advance
public final int advance()
Next codepoint, given the first byte of any UTF-8 byte sequence is already known. Not necessarily a valid char (this function can be used a straight UTF8 decoder)- Specified by:
advancein interfaceCharStream
-
advance
public static final int advance(InputStreamBuffered input)
Next codepoint
-
decode
public static java.lang.String decode(byte[] bytes)
-
-