public class AsyncSocketImpl.AsyncSocketInputStream extends AsyncInputStream
AsyncInputStream of the AsyncSocketImpl.| Constructor and Description |
|---|
AsyncSocketInputStream() |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Return the number of bytes available in the buffer.
|
void |
close() |
BufferMonitor |
createMonitor(long position,
MonitorListener listener)
Create alarm for
|
int |
getBufferSize()
Get the number of bytes the stream buffers from TCP stack.
|
long |
getPosition()
Get stream position.
|
long |
getReceivedBytes()
Get the number of bytes received to this stream
|
void |
peek(byte[] buf)
Peek ahead into buffered content.
|
void |
peek(byte[] buf,
int off,
int len)
Peek bytes to buffer
|
ByteBuffer |
peek(int len)
Peek bytes to returned buffer
|
ByteBuffer[] |
peekChunks(int len)
Peek bytes to byte chunks.
|
int |
read(byte[] b)
Reads some number of bytes from the input stream and stores them into the buffer array
b. |
int |
read(byte[] b,
int off,
int len) |
void |
read(ByteBuffer dst)
Read to byte buffer
|
void |
read(ByteBuffer dst,
int length)
Read the given number of bytes to byte buffer.
|
ByteBuffer |
read(int len)
Read from the stream.
|
ByteBuffer[] |
readChunks(int len)
Read from the input stream.
|
void |
setBufferSize(int size)
Set a hint number for buffering.
|
public int available()
AsyncInputStreamavailable in class AsyncInputStreampublic void close()
public BufferMonitor createMonitor(long position, MonitorListener listener)
createMonitor in class AsyncInputStreamposition - position to triggerlistener - alarm listenerpublic int getBufferSize()
AsyncInputStreamgetBufferSize in class AsyncInputStreampublic long getPosition()
getPosition in class AsyncInputStreampublic long getReceivedBytes()
getReceivedBytes in class AsyncInputStreampublic void peek(byte[] buf)
AsyncInputStreampeek in class AsyncInputStreambuf - an array of byte.public void peek(byte[] buf,
int off,
int len)
AsyncInputStreampeek in class AsyncInputStreambuf - an array of byte.off - a int.len - a int.public ByteBuffer peek(int len)
AsyncInputStreampeek in class AsyncInputStreamlen - a int.public ByteBuffer[] peekChunks(int len)
AsyncInputStreampeekChunks in class AsyncInputStreamlen - a int.public int read(byte[] b)
AsyncInputStreamb. The number of bytes actually read is returned as an integer. This method blocks
until input data is available, end of file is detected, or an exception is thrown.read in class AsyncInputStreamb - the buffer into which the data is read.-1 is there is no more
data because the end of the stream has been reached.InputStream.read(byte[], int, int)public int read(byte[] b,
int off,
int len)
public void read(ByteBuffer dst)
AsyncInputStreamread in class AsyncInputStreamdst - a ByteBuffer object.public void read(ByteBuffer dst, int length)
AsyncInputStreamread in class AsyncInputStreamdst - a ByteBuffer object.length - a int.public ByteBuffer read(int len)
AsyncInputStreamread in class AsyncInputStreamlen - a int.public ByteBuffer[] readChunks(int len)
AsyncInputStreamreadChunks in class AsyncInputStreamlen - a int.public void setBufferSize(int size)
AsyncInputStreamsetBufferSize in class AsyncInputStreamsize - new buffer size valueCopyright © 2026. All rights reserved.