Package com.caucho.hessian.mux
Class MuxInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.caucho.hessian.mux.MuxInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MuxInputStream extends InputStream
Input stream to a specific channel.
-
-
Field Summary
Fields Modifier and Type Field Description protected InputStreamis
-
Constructor Summary
Constructors Constructor Description MuxInputStream()Null argument constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Complete writing to the stream, closing the channel.intgetChannel()Gets the channel of the connection.protected InputStreamgetInputStream()Gets the raw input stream.StringgetURL()Returns the request's URLprotected voidinit(MuxServer server, int channel)Initialize the multiplexor with input and output streams.intread()Writes a data byte to the output stream.protected voidreadTag(int tag)Subclasses will extend this to read values.protected StringreadUTF()Reads a UTF-8 string.-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Field Detail
-
is
protected InputStream is
-
-
Method Detail
-
init
protected void init(MuxServer server, int channel) throws IOException
Initialize the multiplexor with input and output streams.- Throws:
IOException
-
getInputStream
protected InputStream getInputStream() throws IOException
Gets the raw input stream. Clients will normally not call this.- Throws:
IOException
-
getChannel
public int getChannel()
Gets the channel of the connection.
-
getURL
public String getURL()
Returns the request's URL
-
read
public int read() throws IOExceptionWrites a data byte to the output stream.- Specified by:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOExceptionComplete writing to the stream, closing the channel.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
readTag
protected void readTag(int tag) throws IOExceptionSubclasses will extend this to read values.- Throws:
IOException
-
readUTF
protected String readUTF() throws IOException
Reads a UTF-8 string.- Returns:
- the utf-8 encoded string
- Throws:
IOException
-
-