public abstract class AbstractByteBufferInputStream extends InputStream
This class is not synchronized.
Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
m_buffer |
Constructor and Description |
---|
AbstractByteBufferInputStream(ByteBuffer p_buffer,
boolean p_bContainsData)
Create an input stream that reads a
java.nio.ByteBuffer . |
AbstractByteBufferInputStream(int p_iCapacity) |
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or skipped over)
from this input stream without blocking by the next invocation of a method
for this input stream.
|
void |
close()
This method does nothing.
|
void |
mark(int p_iReadlimit) |
boolean |
markSupported()
Marks are not supported by this stream.
|
int |
read() |
int |
read(byte[] p_buf) |
int |
read(byte[] p_buf,
int p_iOffs,
int p_iLen) |
abstract int |
read(ByteBuffer p_buffer)
Read bytes into the given input buffer.
|
void |
reset() |
long |
skip(long p_lSkip) |
protected ByteBuffer m_buffer
public AbstractByteBufferInputStream(ByteBuffer p_buffer, boolean p_bContainsData)
java.nio.ByteBuffer
.
The given buffer will be read and will be passed in calls to the
read(ByteBuffer)
in order to be refilled.
p_buffer
- The buffer to be read.p_bContainsData
- true
if the buffer already contains
data and is prepared for subsequent relative get
operations, or false
if the buffer does not contain any
data that should be read by this input stream.public AbstractByteBufferInputStream(int p_iCapacity)
public int available() throws IOException
The value is equal to the number of bytes remaining in the underlying buffer,
or 1
if the underlying buffer contains no data when this method is
called.
available
in class InputStream
IOException
Buffer.remaining()
public boolean markSupported()
markSupported
in class InputStream
false
;public void mark(int p_iReadlimit)
mark
in class InputStream
UnsupportedOperationException
- Marks are not supported by this stream.public void reset() throws IOException
reset
in class InputStream
UnsupportedOperationException
- Marks are not supported by this stream.IOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] p_buf, int p_iOffs, int p_iLen) throws IOException
read
in class InputStream
IOException
public int read(byte[] p_buf) throws IOException
read
in class InputStream
IOException
public long skip(long p_lSkip) throws IOException
skip
in class InputStream
IOException
public abstract int read(ByteBuffer p_buffer) throws IOException
Note:
get
operations.
p_buffer
- The buffer.-1
if no
more input is available.IOException
- If an I/O error occurred.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2009-2013 Alexander Veit. All Rights Reserved.