Class CharsetSniffingInputStream

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

    public class CharsetSniffingInputStream
    extends java.io.FilterInputStream
    Will attempt to autodetect the character encoding from the stream By default, this will preserve the BOM if it exists
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEncoding()  
      boolean isBomSet()  
      • Methods inherited from class java.io.FilterInputStream

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

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

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

      • CharsetSniffingInputStream

        public CharsetSniffingInputStream​(java.io.InputStream in)
      • CharsetSniffingInputStream

        public CharsetSniffingInputStream​(java.io.InputStream in,
                                          boolean preserveBom)
    • Method Detail

      • isBomSet

        public boolean isBomSet()
      • getEncoding

        public java.lang.String getEncoding()