Class CharsetStreamTranslator

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

    @ParametersAreNonnullByDefault
    public class CharsetStreamTranslator
    extends java.io.InputStream
    Input stream translation class which converts from input charset to target charset.
    • Field Summary

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

      Constructors 
      Constructor Description
      CharsetStreamTranslator​(java.nio.charset.Charset inputCharset, java.nio.charset.Charset outputCharset, java.io.InputStream source)  
      CharsetStreamTranslator​(java.nio.charset.Charset inputCharset, java.nio.charset.Charset outputCharset, java.io.InputStream source, int bufferSize)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      void processNext()  
      int read()  
      int read​(byte[] buffer, int offset, int length)  
      • Methods inherited from class java.io.InputStream

        close, mark, markSupported, nullInputStream, 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

      • CharsetStreamTranslator

        public CharsetStreamTranslator​(java.nio.charset.Charset inputCharset,
                                       java.nio.charset.Charset outputCharset,
                                       java.io.InputStream source,
                                       int bufferSize)
      • CharsetStreamTranslator

        public CharsetStreamTranslator​(java.nio.charset.Charset inputCharset,
                                       java.nio.charset.Charset outputCharset,
                                       java.io.InputStream source)
    • Method Detail

      • read

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

        public int read​(byte[] buffer,
                        int offset,
                        int length)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • processNext

        public void processNext()
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException