Class RandomAccessStream
java.lang.Object
com.twelvemonkeys.io.RandomAccessStream
- All Implemented Interfaces:
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 $
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) SeekableInputStreamThis random access stream, wrapped in anInputStream(package private) SeekableOutputStreamThis random access stream, wrapped in anOutputStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SeekableInputStreamReturns an input view of thisRandomAccessStream.final SeekableOutputStreamReturns an output view of thisRandomAccessStream.intread()final intread(byte[] pBytes) intread(byte[] pBytes, int pOffset, int pLength) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesMethods inherited from interface DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFMethods inherited from interface Seekable
close, flush, flushBefore, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, mark, reset, seek
-
Field Details
-
inputView
SeekableInputStream inputViewThis random access stream, wrapped in anInputStream -
outputView
SeekableOutputStream outputViewThis random access stream, wrapped in anOutputStream
-
-
Constructor Details
-
RandomAccessStream
public RandomAccessStream()
-
-
Method Details
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
asInputStream
Returns an input view of thisRandomAccessStream. Invoking this method several times, will return the same object.Note that read access is NOT synchronized.
- Returns:
- a
SeekableInputStreamreading from this stream
-
asOutputStream
Returns an output view of thisRandomAccessStream. Invoking this method several times, will return the same object.Note that write access is NOT synchronized.
- Returns:
- a
SeekableOutputStreamwriting to this stream
-