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 FileFragmentInputStream

    java.lang.Object
      io.FileFragmentInputStream

All Implemented Interfaces:
  java.lang.Iterable<java.io.InputStream>

    public class FileFragmentInputStream

extends java.lang.Object
implements java.lang.Iterable<java.io.InputStream>

This class provides iterator over decorated file input stream. It facilitates splitting file into several fragments. This class is iterable over input streams that read can fixed length fragments of file. Decorated input streams prevents user from skipping out of fragment of file and paddes last fragment to ensure equal lenght of all fragments. Inner iterator provides input streams that enable user to read fixed lenght portions or fragments of file. Only parts of file corresponding to input stream can be read. Fragments are non overlaping and continuous. Every byte of file will be accessible via some of iterated input streams.

See Also:
  `PaddingInputStream`

Constructor Summary
`FileFragmentInputStream(java.io.File file, long fragmentSize)` Constructor sets input parameters for later use by inner iterator.

Method Summary
`java.util.Iterator<java.io.InputStream>` | `iterator()` Returns iterator over decorated input streams.

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

Constructor Detail

### FileFragmentInputStream

    public FileFragmentInputStream(java.io.File file,
                                   long fragmentSize)

  Constructor sets input parameters for later use by inner iterator.

  Parameters:
    `file` - File to be divided into fragments
    `fragmentSize` - Size of every fragment

Method Detail

### iterator

    public java.util.Iterator<java.io.InputStream> iterator()

  Returns iterator over decorated input streams. This input streams are padded, if they reach end of file, so it is ensured that equal number of bytes can be read from each stream. On the other hand, input streams will only read portion of file coresponding to their fragment efectively preventing mixing of fragments.

  Specified by:
    `iterator` in interface `java.lang.Iterable<java.io.InputStream>`
  Returns:
    Iterator over input streams.

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