Class RandomAccessStream

java.lang.Object
com.twelvemonkeys.io.RandomAccessStream
All Implemented Interfaces:
Seekable, DataInput, DataOutput

public abstract class RandomAccessStream extends Object implements Seekable, DataInput, DataOutput
A data stream that is both readable and writable, much like a RandomAccessFile, except it may be backed by something other than a file.
Version:
$Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/RandomAccessStream.java#3 $
Author:
Harald Kuhr, last modified by $Author: haku $
See Also:
  • Constructor Details

    • RandomAccessStream

      public RandomAccessStream()
  • Method Details

    • read

      public int read() throws IOException
      Throws:
      IOException
    • read

      public int read(byte[] pBytes, int pOffset, int pLength) throws IOException
      Throws:
      IOException
    • read

      public final int read(byte[] pBytes) throws IOException
      Throws:
      IOException
    • asInputStream

      public final SeekableInputStream asInputStream()
      Returns an input view of this RandomAccessStream. Invoking this method several times, will return the same object.

      Note that read access is NOT synchronized.

      Returns:
      a SeekableInputStream reading from this stream
    • asOutputStream

      public final SeekableOutputStream asOutputStream()
      Returns an output view of this RandomAccessStream. Invoking this method several times, will return the same object.

      Note that write access is NOT synchronized.

      Returns:
      a SeekableOutputStream writing to this stream