Class 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int advance()
      Next codepoint, given the first byte of any UTF-8 byte sequence is already known.
      static int advance​(InputStreamBuffered input)
      Next codepoint
      void close()  
      void closeStream()
      Close the stream - different name from java.io.Reader.close
      static java.lang.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, nullReader, read, read, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InStreamUTF8

        public InStreamUTF8​(java.io.InputStream in)
    • Method Detail

      • ready

        public boolean ready()
                      throws java.io.IOException
        Overrides:
        ready in class java.io.Reader
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Reader
        Throws:
        java.io.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)
        Specified by:
        read in class java.io.Reader
      • read

        public final int read()
        Overrides:
        read in class java.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:
        advance in interface CharStream
      • decode

        public static java.lang.String decode​(byte[] bytes)