Package com.caucho.hessian.mux
Class MuxOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.caucho.hessian.mux.MuxOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class MuxOutputStream extends java.io.OutputStreamOutput stream to a specific channel.
-
-
Constructor Summary
Constructors Constructor Description MuxOutputStream()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.voidflush()Flush data to the output stream.intgetChannel()Gets the channel of the connection.protected java.io.OutputStreamgetOutputStream()Gets the raw output stream.protected voidinit(MuxServer server, int channel)Initialize the multiplexor with input and output streams.voidwrite(byte[] buffer, int offset, int length)Writes data to the output stream.voidwrite(int ch)Writes a data byte to the output stream.voidwriteURL(java.lang.String url)Writes a URL to the stream.protected voidwriteUTF(int code, java.lang.String string)Writes a UTF-8 string.voidyield()Flush data to the output stream.
-
-
-
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
-
getOutputStream
protected java.io.OutputStream getOutputStream() throws java.io.IOExceptionGets the raw output stream. Clients will normally not call this.- Throws:
java.io.IOException
-
getChannel
public int getChannel()
Gets the channel of the connection.
-
writeURL
public void writeURL(java.lang.String url) throws java.io.IOExceptionWrites a URL to the stream.- Throws:
java.io.IOException
-
write
public void write(int ch) throws java.io.IOExceptionWrites a data byte to the output stream.- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] buffer, int offset, int length) throws java.io.IOExceptionWrites data to the output stream.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
yield
public void yield() throws java.io.IOExceptionFlush data to the output stream.- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionFlush data to the output stream.- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- 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.OutputStream- Throws:
java.io.IOException
-
writeUTF
protected void writeUTF(int code, java.lang.String string) throws java.io.IOExceptionWrites a UTF-8 string.- Parameters:
code- the HMUX code identifying the stringstring- the string to write- Throws:
java.io.IOException
-
-