Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## io
Class PaddingInputStream

    java.lang.Object
      java.io.InputStream
          io.PaddingInputStream

All Implemented Interfaces:
  java.io.Closeable

    public class PaddingInputStream

extends java.io.InputStream

This decorated input stream is capable of reading fixed number of bytes. In case that underlying input stream ends before required number of bytes has been read, zero bytes are returned. If maximum number of bytes allowed has been read, this stream will start to indicate end of stream even when underlying stream is not yet at the end.

See Also:
  `InputStream`

Constructor Summary
`PaddingInputStream(java.io.InputStream in, long fragmentSize)` Constructor that will create decorated input stream.

Method Summary
`int` | `read()` Overrided method that guarantees desired properties of stream.

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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PaddingInputStream

    public PaddingInputStream(java.io.InputStream in,
                              long fragmentSize)

  Constructor that will create decorated input stream.

  Parameters:
    `in` - input stream to be decorated
    `fragmentSize` - number of bytes expected to be read

Method Detail

### read

    public int read()
             throws java.io.IOException

  Overrided method that guarantees desired properties of stream.

  Specified by:
    `read` in class `java.io.InputStream`
  Returns:
    single byte of file or -1 if stream has reached its end
  Throws:
    `java.io.IOException` - if decorated input stream encounters error on read

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD