Class UnicodeDetectingInputStream

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

    class UnicodeDetectingInputStream
    extends java.io.FilterInputStream
    A filter stream that detects the unicode encoding for the original stream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte BB  
      private static byte BF  
      private byte[] buf  
      private int bufLen  
      private java.nio.charset.Charset charset  
      private int curIndex  
      private static byte EF  
      private static byte FE  
      private static byte FF  
      private static byte NUL  
      private static java.nio.charset.Charset utf32Be  
      private static java.nio.charset.Charset utf32Le  
      • Fields inherited from class java.io.FilterInputStream

        in
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.nio.charset.Charset detectEncoding()  
      private void fillBuf()  
      (package private) java.nio.charset.Charset getCharset()  
      private static java.nio.charset.Charset getUtf32be()  
      private static java.nio.charset.Charset getUtf32le()  
      int read()  
      int read​(byte[] b, int off, int len)  
      • Methods inherited from class java.io.FilterInputStream

        available, close, mark, markSupported, read, reset, skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

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

      • UnicodeDetectingInputStream

        UnicodeDetectingInputStream​(java.io.InputStream is)
    • Method Detail

      • getCharset

        java.nio.charset.Charset getCharset()
      • fillBuf

        private void fillBuf()
      • detectEncoding

        private java.nio.charset.Charset detectEncoding()
      • getUtf32be

        private static java.nio.charset.Charset getUtf32be()
      • getUtf32le

        private static java.nio.charset.Charset getUtf32le()
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException