Package de.intarsys.tools.randomaccess
Class AbstractRandomAccess
- java.lang.Object
-
- de.intarsys.tools.randomaccess.AbstractRandomAccess
-
- All Implemented Interfaces:
IRandomAccess
- Direct Known Subclasses:
BufferedRandomAccess
,RandomAccessByteArray
,RandomAccessFile
,RandomAccessFilter
public abstract class AbstractRandomAccess extends java.lang.Object implements IRandomAccess
Supports reading and writing to a random access data container. A random access data container behaves like a large array of bytes.
-
-
Constructor Summary
Constructors Constructor Description AbstractRandomAccess()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
asInputStream()
AInputStream
view on the data structure.java.io.OutputStream
asOutputStream()
AOutputStream
view on the data structure.protected java.util.Stack
getPositionStack()
void
mark()
Mark the current offset into the data in a stack like manner.void
reset()
Reset to the last position on the mark-stack.
-
-
-
Method Detail
-
asInputStream
public java.io.InputStream asInputStream()
Description copied from interface:IRandomAccess
AInputStream
view on the data structure.- Specified by:
asInputStream
in interfaceIRandomAccess
- Returns:
- A
InputStream
view on the data structure.
-
asOutputStream
public java.io.OutputStream asOutputStream()
Description copied from interface:IRandomAccess
AOutputStream
view on the data structure.- Specified by:
asOutputStream
in interfaceIRandomAccess
- Returns:
- A
OutputStream
view on the data structure.
-
mark
public void mark() throws java.io.IOException
Description copied from interface:IRandomAccess
Mark the current offset into the data in a stack like manner.- Specified by:
mark
in interfaceIRandomAccess
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException
Description copied from interface:IRandomAccess
Reset to the last position on the mark-stack.- Specified by:
reset
in interfaceIRandomAccess
- Throws:
java.io.IOException
-
getPositionStack
protected java.util.Stack getPositionStack()
- Returns:
- Returns the positionStack.
-
-