Class UTFInputStreamReader

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

    public final class UTFInputStreamReader
    extends java.io.InputStreamReader
    Detects the different UTF encodings from byte order mark.
    Since:
    3372
    • Field Summary

      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UTFInputStreamReader​(java.io.InputStream in, java.lang.String cs)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static UTFInputStreamReader create​(java.io.InputStream input)
      Creates a new InputStreamReader from the InputStream with UTF-8 as default encoding.
      static UTFInputStreamReader create​(java.io.InputStream input, java.lang.String defaultEncoding)
      Creates a new InputStreamReader from the InputStream.
      • Methods inherited from class java.io.InputStreamReader

        close, getEncoding, read, read, ready
      • Methods inherited from class java.io.Reader

        mark, markSupported, nullReader, read, read, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • UTFInputStreamReader

        private UTFInputStreamReader​(java.io.InputStream in,
                                     java.lang.String cs)
                              throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
    • Method Detail

      • create

        public static UTFInputStreamReader create​(java.io.InputStream input)
                                           throws java.io.IOException
        Creates a new InputStreamReader from the InputStream with UTF-8 as default encoding.
        Parameters:
        input - input stream
        Returns:
        A reader with the correct encoding. Starts to read after the BOM.
        Throws:
        java.io.IOException - if any I/O error occurs
        See Also:
        create(java.io.InputStream, String)
      • create

        public static UTFInputStreamReader create​(java.io.InputStream input,
                                                  java.lang.String defaultEncoding)
                                           throws java.io.IOException
        Creates a new InputStreamReader from the InputStream.
        Parameters:
        input - input stream
        defaultEncoding - Used, when no BOM was recognized. Can be null.
        Returns:
        A reader with the correct encoding. Starts to read after the BOM.
        Throws:
        java.io.IOException - if any I/O error occurs