java.lang.Object
java.io.OutputStream
nectar.reda.io.RedaOutputStream
- public class RedaOutputStream
- extends java.io.OutputStream
|
Method Summary |
void |
close()
This method doesn't do anything. |
void |
flush()
Flush the buffered bytes in this stream and actually write all of them out to
the underlying connection. |
void |
write(byte[] b)
This method all the writes bytes from the passed array to the
output stream. |
void |
write(byte[] src,
int off,
int len)
write a byte array to the underlying RedaConnection, which will compress and encrypt it. |
void |
write(int param)
This method writes a single byte to the output stream. |
private void |
writeToConnection(byte[] src,
int off,
int len)
write a byte array to the underlying RedaConnection, which will compress and encrypt it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
connection
private RedaConnection connection
buff
private byte[] buff
pos
private int pos
MAX_BUFFER_SIZE
private static int MAX_BUFFER_SIZE
RedaOutputStream
public RedaOutputStream(RedaConnection connection)
- Creates a new instance of ReadOutputStream
writeToConnection
private void writeToConnection(byte[] src,
int off,
int len)
throws java.io.IOException
- write a byte array to the underlying RedaConnection, which will compress and encrypt it.
if the byte array is larger than RedaConnection.MAX_PACKET_SIZE, this method will segment the packet
before sending it out.
write
public void write(byte[] src,
int off,
int len)
throws java.io.IOException
- write a byte array to the underlying RedaConnection, which will compress and encrypt it.
you must call the
flush() method on this InputStream to actually write the data out to the connection. this method is lazy and buffers data until MAX_PACKET_SIZE is reached, at which point it will flush it's buffer to the connection.
write
public void write(int param)
throws java.io.IOException
- Description copied from class:
java.io.OutputStream
- This method writes a single byte to the output stream. The byte written
is the low eight bits of the
int passed and a argument.
Subclasses must provide an implementation of this abstract method
write
public void write(byte[] b)
throws java.io.IOException
- Description copied from class:
java.io.OutputStream
- This method all the writes bytes from the passed array to the
output stream. This method is equivalent to
write(b, 0,
buf.length) which is exactly how it is implemented in this
class.
flush
public void flush()
throws java.io.IOException
- Flush the buffered bytes in this stream and actually write all of them out to
the underlying connection.
close
public void close()
throws java.io.IOException
- This method doesn't do anything. To disconnect, use the RecordConnection.disconnect() method.