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 TypeMethodDescriptionvoidclose()Complete writing to the stream, closing the channel.voidflush()Flush data to the output stream.intGets the channel of the connection.protected OutputStreamGets the raw output stream.protected voidInitialize 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.voidWrites a URL to the stream.protected voidWrites a UTF-8 string.voidyield()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:
writein classOutputStream- Throws:
IOException
-
write
Writes data to the output stream.- Overrides:
writein classOutputStream- Throws:
IOException
-
yield
Flush data to the output stream.- Throws:
IOException
-
flush
Flush data to the output stream.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
Complete writing to the stream, closing the channel.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
writeUTF
Writes a UTF-8 string.- Parameters:
code- the HMUX code identifying the stringstring- the string to write- Throws:
IOException
-