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

## org.archive.io
Class ArraySeekInputStream

    java.lang.Object
      java.io.InputStream
          org.archive.io.SeekInputStream
              org.archive.io.ArraySeekInputStream

All Implemented Interfaces:
  it.unimi.dsi.fastutil.io.RepositionableStream, java.io.Closeable

    public class ArraySeekInputStream

extends SeekInputStream

A repositionable stream backed by an array.

Author:
  pjack

Constructor Summary
`ArraySeekInputStream(byte[] array)` Constructor.

Method Summary
`long` | `position()` Returns the position of the stream.
`void` | `position(long p)` Repositions the stream.
`int` | `read()`
`int` | `read(byte[] buf)`
`int` | `read(byte[] buf, int ofs, int len)`

Methods inherited from class org.archive.io.SeekInputStream
`mark, markSupported, reset`

Methods inherited from class java.io.InputStream
`available, close, skip`

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

Constructor Detail

### ArraySeekInputStream

    public ArraySeekInputStream(byte[] array)

  Constructor. Note that changes to the given array will be reflected in the stream.

  Parameters:
    `array` - The array to read bytes from.

Method Detail

### read

    public int read()

  Specified by:
    `read` in class `java.io.InputStream`

### read

    public int read(byte[] buf,
                    int ofs,
                    int len)

  Overrides:
    `read` in class `java.io.InputStream`

### read

    public int read(byte[] buf)

  Overrides:
    `read` in class `java.io.InputStream`

### position

    public long position()

  Returns the position of the stream.

### position

    public void position(long p)
                  throws java.io.IOException

  Repositions the stream.

  Parameters:
    `p` - the new position for the stream
  Throws:
    `java.io.IOException` - if the given position is out of bounds

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

Copyright © 2003-2008 Internet Archive. All Rights Reserved.