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.InputStreamasInputStream()AInputStreamview on the data structure.java.io.OutputStreamasOutputStream()AOutputStreamview on the data structure.protected java.util.StackgetPositionStack()voidmark()Mark the current offset into the data in a stack like manner.voidreset()Reset to the last position on the mark-stack.
-
-
-
Method Detail
-
asInputStream
public java.io.InputStream asInputStream()
Description copied from interface:IRandomAccessAInputStreamview on the data structure.- Specified by:
asInputStreamin interfaceIRandomAccess- Returns:
- A
InputStreamview on the data structure.
-
asOutputStream
public java.io.OutputStream asOutputStream()
Description copied from interface:IRandomAccessAOutputStreamview on the data structure.- Specified by:
asOutputStreamin interfaceIRandomAccess- Returns:
- A
OutputStreamview on the data structure.
-
mark
public void mark() throws java.io.IOExceptionDescription copied from interface:IRandomAccessMark the current offset into the data in a stack like manner.- Specified by:
markin interfaceIRandomAccess- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOExceptionDescription copied from interface:IRandomAccessReset to the last position on the mark-stack.- Specified by:
resetin interfaceIRandomAccess- Throws:
java.io.IOException
-
getPositionStack
protected java.util.Stack getPositionStack()
- Returns:
- Returns the positionStack.
-
-