Class DecoderStream

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

    public final class DecoderStream
    extends java.io.FilterInputStream
    An InputStream that provides on-the-fly decoding from an underlying stream.
    Version:
    $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/enc/DecoderStream.java#2 $
    Author:
    Harald Kuhr
    See Also:
    EncoderStream, Decoder
    • Field Summary

      • Fields inherited from class java.io.FilterInputStream

        in
    • Constructor Summary

      Constructors 
      Constructor Description
      DecoderStream​(java.io.InputStream stream, Decoder decoder)
      Creates a new decoder stream and chains it to the input stream specified by the stream argument.
      DecoderStream​(java.io.InputStream stream, Decoder decoder, int bufferSize)
      Creates a new decoder stream and chains it to the input stream specified by the stream argument.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      int read()  
      int read​(byte[] bytes, int offset, int length)  
      long skip​(long length)  
      • Methods inherited from class java.io.FilterInputStream

        close, mark, markSupported, read, reset
      • 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

      • DecoderStream

        public DecoderStream​(java.io.InputStream stream,
                             Decoder decoder)
        Creates a new decoder stream and chains it to the input stream specified by the stream argument. The stream will use a default decode buffer size.
        Parameters:
        stream - the underlying input stream.
        decoder - the decoder that will be used to decode the underlying stream
        See Also:
        FilterInputStream.in
      • DecoderStream

        public DecoderStream​(java.io.InputStream stream,
                             Decoder decoder,
                             int bufferSize)
        Creates a new decoder stream and chains it to the input stream specified by the stream argument.
        Parameters:
        stream - the underlying input stream.
        decoder - the decoder that will be used to decode the underlying stream
        bufferSize - the size of the decode buffer
        See Also:
        FilterInputStream.in
    • Method Detail

      • available

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

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

        public int read​(byte[] bytes,
                        int offset,
                        int length)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long length)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.FilterInputStream
        Throws:
        java.io.IOException