Class UnicodeUtil.UnicodeInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    UnicodeUtil

    public static class UnicodeUtil.UnicodeInputStream
    extends java.io.InputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BOM_SIZE  
    • Constructor Summary

      Constructors 
      Constructor Description
      UnicodeInputStream​(java.io.InputStream in, java.lang.String defaultEnc)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int getBOMOffset()  
      java.lang.String getDefaultEncoding()  
      java.lang.String getEncoding()  
      protected void init()
      Read-ahead four bytes and check for BOM marks.
      int read()  
      • Methods inherited from class java.io.InputStream

        available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • UnicodeInputStream

        public UnicodeInputStream​(java.io.InputStream in,
                                  java.lang.String defaultEnc)
    • Method Detail

      • getDefaultEncoding

        public java.lang.String getDefaultEncoding()
      • getEncoding

        public java.lang.String getEncoding()
      • init

        protected void init()
                     throws java.io.IOException
        Read-ahead four bytes and check for BOM marks. Extra bytes are unread back to the stream, only BOM bytes are skipped.
        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
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • getBOMOffset

        public int getBOMOffset()