|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--org.w3c.www.mux.MuxInputStream
Field Summary | |
protected int |
avail_credit
Current available credit on that session. |
protected byte[] |
buffer
This input stream associated buffer. |
protected int |
buflen
The current buffer length. |
protected int |
bufptr
The current buffer position. |
protected boolean |
closed
Has this stream been closed ? |
protected int |
consumed_credit
Currently consumed credits. |
protected java.lang.String |
errmsg
Error message in case of error. |
protected int |
markptr
The current mark within the input buffer, or -1. |
protected boolean |
pushpending
Yet another push is pending from the reader thread. |
protected MuxSession |
session
The MuxSession instance this input stream is attached to. |
protected org.w3c.www.mux.MuxWriter |
writer
A quick reference to that session writer. |
Constructor Summary | |
protected |
MuxInputStream(MuxSession session)
Create an input stream to read data from the given session. |
Method Summary | |
int |
available()
Get the number of available bytes on that stream. |
void |
close()
Close that input stream. |
protected void |
error(java.lang.String msg)
Notify that stream of some error condition. |
void |
mark(int readlimit)
Set a mark in that input stream. |
protected void |
push(byte[] data,
int off,
int len,
boolean noflush)
Fill in that input stream with more data. |
int |
read()
Read one byte of input from the stream. |
int |
read(byte[] b,
int off,
int len)
Reads into an array of bytes. |
void |
reset()
Reset buffer to last mark. |
Methods inherited from class java.io.InputStream |
markSupported,
read,
skip |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected MuxSession session
protected org.w3c.www.mux.MuxWriter writer
protected byte[] buffer
protected int bufptr
protected int markptr
protected int buflen
protected boolean closed
protected int consumed_credit
protected int avail_credit
protected boolean pushpending
protected java.lang.String errmsg
Constructor Detail |
protected MuxInputStream(MuxSession session)
session
- The session to read data from.Method Detail |
protected void push(byte[] data, int off, int len, boolean noflush) throws java.io.IOException
data
- The data read from the socket.off
- Offset of available data within above buffer.len
- Length of available data within above buffer.noflush
- Set to true if there is already more
data available for that session.public void mark(int readlimit)
readlimit
- The maximum limit of bytes allowed to be read
before the mark becomes invalid.public void reset() throws java.io.IOException
protected void error(java.lang.String msg)
msg
- Error message to be provided in any future IOException.public int available() throws java.io.IOException
public void close() throws java.io.IOException
public int read() throws java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |