Package org.jmrtd.io
Class InputStreamBuffer.SubInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.jmrtd.io.InputStreamBuffer.SubInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- InputStreamBuffer
public class InputStreamBuffer.SubInputStream extends InputStream
The sub-input stream to serve to clients.
-
-
Constructor Summary
Constructors Constructor Description SubInputStream(Object syncObject)
Creates a sub-stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
FragmentBuffer
getBuffer()
Returns the underlying fragment buffer.int
getPosition()
The position within this stream.void
mark(int readLimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset()
long
skip(long n)
-
Methods inherited from class java.io.InputStream
readAllBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
SubInputStream
public SubInputStream(Object syncObject)
Creates a sub-stream.- Parameters:
syncObject
- an object for locking
-
-
Method Detail
-
getBuffer
public FragmentBuffer getBuffer()
Returns the underlying fragment buffer.- Returns:
- the buffer
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
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 int getPosition()
The position within this stream.- Returns:
- the position
-
-