org.openjena.atlas.io
Class InStreamUTF8

java.lang.Object
  extended by java.io.Reader
      extended by org.openjena.atlas.io.InStreamUTF8
All Implemented Interfaces:
Closeable, Readable, CharStream

public final class InStreamUTF8
extends Reader
implements CharStream

Fast and streaming UTF-8


Constructor Summary
InStreamUTF8(InputStream in)
           
InStreamUTF8(InputStreamBuffered in)
           
 
Method Summary
 int advance()
          Next codepoint, given the first byte of any UTF-8 byte sequence is already known.
static int advance(InputStreamBuffered input)
          Next codepoint
static int advance(InputStreamBuffered input, int x)
          Next codepoint, given the first byte of any UTF-8 byte sequence is already known.
 void close()
           
 void closeStream()
          Close the stream - different name from java.io.Reader.close
static String decode(byte[] bytes)
           
 int read()
           
 int read(char[] cbuf, int off, int len)
           
 boolean ready()
           
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InStreamUTF8

public InStreamUTF8(InputStream in)

InStreamUTF8

public InStreamUTF8(InputStreamBuffered in)
Method Detail

ready

public boolean ready()
              throws IOException
Overrides:
ready in class Reader
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException

closeStream

public void closeStream()
Description copied from interface: CharStream
Close the stream - different name from java.io.Reader.close

Specified by:
closeStream in interface CharStream

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Specified by:
read in class Reader
Throws:
IOException

read

public final int read()
               throws IOException
Overrides:
read in class Reader
Throws:
IOException

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:
advance in interface CharStream

advance

public static final int advance(InputStreamBuffered input)
Next codepoint


advance

public static final int advance(InputStreamBuffered input,
                                int x)
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


decode

public static String decode(byte[] bytes)


Licenced under the Apache License, Version 2.0