Package com.caucho.hessian.mux
Class MuxInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.caucho.hessian.mux.MuxInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class MuxInputStream extends java.io.InputStreamInput stream to a specific channel.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.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 java.io.InputStreamgetInputStream()Gets the raw input stream.java.lang.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 java.lang.StringreadUTF()Reads a UTF-8 string.
-
-
-
Method Detail
-
init
protected void init(MuxServer server, int channel) throws java.io.IOException
Initialize the multiplexor with input and output streams.- Throws:
java.io.IOException
-
getInputStream
protected java.io.InputStream getInputStream() throws java.io.IOExceptionGets the raw input stream. Clients will normally not call this.- Throws:
java.io.IOException
-
getChannel
public int getChannel()
Gets the channel of the connection.
-
getURL
public java.lang.String getURL()
Returns the request's URL
-
read
public int read() throws java.io.IOExceptionWrites a data byte to the output stream.- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionComplete writing to the stream, closing the channel.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
readTag
protected void readTag(int tag) throws java.io.IOExceptionSubclasses will extend this to read values.- Throws:
java.io.IOException
-
readUTF
protected java.lang.String readUTF() throws java.io.IOExceptionReads a UTF-8 string.- Returns:
- the utf-8 encoded string
- Throws:
java.io.IOException
-
-