Package org.jmrtd.io
Class PositionInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.jmrtd.io.PositionInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class PositionInputStream extends InputStream
A stream that decorates an existing stream and keeps track of the current position.- Version:
- $Revision: 1763 $
- Author:
- The JMRTD team ([email protected])
-
-
Constructor Summary
Constructors Constructor Description PositionInputStream(InputStream carrier)
Constructs a position input stream by decorating an existing input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getPosition()
Returns the position within the input stream.void
mark(int readLimit)
boolean
markSupported()
int
read()
int
read(byte[] dest)
int
read(byte[] dest, int offset, int length)
void
reset()
long
skip(long n)
-
Methods inherited from class java.io.InputStream
available, close, readAllBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
PositionInputStream
public PositionInputStream(InputStream carrier)
Constructs a position input stream by decorating an existing input stream.- Parameters:
carrier
- the existing input stream
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] dest) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] dest, int offset, int length) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classInputStream
-
getPosition
public long getPosition()
Returns the position within the input stream.- Returns:
- the position within the input stream
-
-