Package com.caucho.hessian.mux
Class MuxOutputStream
java.lang.Object
java.io.OutputStream
com.caucho.hessian.mux.MuxOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Output stream to a specific channel.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Complete writing to the stream, closing the channel.void
flush()
Flush data to the output stream.int
Gets the channel of the connection.protected OutputStream
Gets the raw output stream.protected void
Initialize the multiplexor with input and output streams.void
write
(byte[] buffer, int offset, int length) Writes data to the output stream.void
write
(int ch) Writes a data byte to the output stream.void
Writes a URL to the stream.protected void
Writes a UTF-8 string.void
yield()
Flush data to the output stream.Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
MuxOutputStream
public MuxOutputStream()Null argument constructor.
-
-
Method Details
-
init
Initialize the multiplexor with input and output streams.- Throws:
IOException
-
getOutputStream
Gets the raw output stream. Clients will normally not call this.- Throws:
IOException
-
getChannel
public int getChannel()Gets the channel of the connection. -
writeURL
Writes a URL to the stream.- Throws:
IOException
-
write
Writes a data byte to the output stream.- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
Writes data to the output stream.- Overrides:
write
in classOutputStream
- Throws:
IOException
-
yield
Flush data to the output stream.- Throws:
IOException
-
flush
Flush data to the output stream.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
Complete writing to the stream, closing the channel.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
writeUTF
Writes a UTF-8 string.- Parameters:
code
- the HMUX code identifying the stringstring
- the string to write- Throws:
IOException
-