Package org.jboss.remoting3
Class MessageOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.jboss.remoting3.MessageOutputStream
-
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,AutoCloseable
,org.xnio.Cancellable
- Direct Known Subclasses:
AbstractDelegatingMessageOutputStream
public abstract class MessageOutputStream extends OutputStream implements DataOutput, org.xnio.Cancellable
An output stream for a message.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description MessageOutputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract MessageOutputStream
cancel()
Cancel this message stream.abstract void
close()
Close this message stream.abstract void
flush()
Flush this message stream.void
writeBoolean(boolean v)
void
writeByte(int v)
void
writeBytes(String s)
void
writeChar(int v)
void
writeChars(String s)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeShort(int v)
void
writeUTF(String s)
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write, write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.io.DataOutput
write, write, write
-
-
-
-
Method Detail
-
flush
public abstract void flush() throws IOException
Flush this message stream. Any unwritten, buffered bytes are sent to the remote side.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
- if an error occurs while flushing the stream
-
close
public abstract void close() throws IOException
Close this message stream. If the stream is already closed or cancelled, this method has no effect. After this method is called, any further attempts to write to the stream will result in an exception.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
- if a error occurs while closing the stream
-
cancel
public abstract MessageOutputStream cancel()
Cancel this message stream. If the stream is already closed or cancelled, this method has no effect. After this method is called, any further attempts to write to the stream will result in an exception.- Specified by:
cancel
in interfaceorg.xnio.Cancellable
- Returns:
- this stream
-
writeBoolean
public void writeBoolean(boolean v) throws IOException
- Specified by:
writeBoolean
in interfaceDataOutput
- Throws:
IOException
-
writeByte
public void writeByte(int v) throws IOException
- Specified by:
writeByte
in interfaceDataOutput
- Throws:
IOException
-
writeShort
public void writeShort(int v) throws IOException
- Specified by:
writeShort
in interfaceDataOutput
- Throws:
IOException
-
writeChar
public void writeChar(int v) throws IOException
- Specified by:
writeChar
in interfaceDataOutput
- Throws:
IOException
-
writeInt
public void writeInt(int v) throws IOException
- Specified by:
writeInt
in interfaceDataOutput
- Throws:
IOException
-
writeLong
public void writeLong(long v) throws IOException
- Specified by:
writeLong
in interfaceDataOutput
- Throws:
IOException
-
writeFloat
public void writeFloat(float v) throws IOException
- Specified by:
writeFloat
in interfaceDataOutput
- Throws:
IOException
-
writeDouble
public void writeDouble(double v) throws IOException
- Specified by:
writeDouble
in interfaceDataOutput
- Throws:
IOException
-
writeBytes
public void writeBytes(String s) throws IOException
- Specified by:
writeBytes
in interfaceDataOutput
- Throws:
IOException
-
writeChars
public void writeChars(String s) throws IOException
- Specified by:
writeChars
in interfaceDataOutput
- Throws:
IOException
-
writeUTF
public void writeUTF(String s) throws IOException
- Specified by:
writeUTF
in interfaceDataOutput
- Throws:
IOException
-
-