|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StreamWriter
Write the primitive Java types and arrays of primitives to some data sink. This may include internal buffering for efficiency reasons. Note, that StreamWriter implementation may not be thread-safe.
| Method Summary | |
|---|---|
Future<Integer> |
close(CompletionHandler<Integer> completionHandler)
Close the StreamWriter and make sure all data was flushed. |
Future<Integer> |
flush()
Make sure that all data that has been written is flushed from the stream to its destination. |
Future<Integer> |
flush(CompletionHandler<Integer> completionHandler)
Make sure that all data that has been written is flushed from the stream to its destination. |
Buffer |
getBuffer()
Get the current Buffer, where the StreamWriter buffers
output. |
int |
getBufferSize()
Get the preferred Buffer size to be used for StreamWriter
write operations. |
Connection |
getConnection()
Get the Connection this StreamWriter belongs to. |
long |
getTimeout(TimeUnit timeunit)
Get the timeout for StreamWriter I/O operations. |
boolean |
isBlocking()
Returns the StreamReader mode. |
void |
setBlocking(boolean isBlocking)
Sets the StreamReader mode. |
void |
setBufferSize(int size)
Set the preferred Buffer size to be used for StreamWriter
write operations. |
void |
setTimeout(long timeout,
TimeUnit timeunit)
Set the timeout for StreamWriter I/O operations. |
void |
writeBoolean(boolean data)
Write the boolean value to the StreamWriter. |
void |
writeBooleanArray(boolean[] data)
Write the array of boolean values to the StreamWriter. |
void |
writeBuffer(Buffer buffer)
Write the Buffer to the StreamWriter. |
void |
writeByte(byte data)
Write the byte value to the StreamWriter. |
void |
writeByteArray(byte[] data)
Write the array of byte values to the StreamWriter. |
void |
writeByteArray(byte[] data,
int offset,
int length)
Write the part of array of byte values to the StreamWriter, using specific offset and length values. |
void |
writeChar(char data)
Write the char value to the StreamWriter. |
void |
writeCharArray(char[] data)
Write the array of char values to the StreamWriter. |
void |
writeDouble(double data)
Write the double value to the StreamWriter. |
void |
writeDoubleArray(double[] data)
Write the array of double values to the StreamWriter. |
void |
writeFloat(float data)
Write the float value to the StreamWriter. |
void |
writeFloatArray(float[] data)
Write the array of float values to the StreamWriter. |
void |
writeInt(int data)
Write the int value to the StreamWriter. |
void |
writeIntArray(int[] data)
Write the array of int values to the StreamWriter. |
void |
writeLong(long data)
Write the long value to the StreamWriter. |
void |
writeLongArray(long[] data)
Write the array of long values to the StreamWriter. |
void |
writeShort(short data)
Write the short value to the StreamWriter. |
void |
writeShortArray(short[] data)
Write the array of short values to the StreamWriter. |
void |
writeStream(StreamReader stream)
Puts StreamReader available data to this StreamWriter
This method will make possible direct writing from StreamReader,
avoiding Buffer copying. |
| Methods inherited from interface java.io.Closeable |
|---|
close |
| Method Detail |
|---|
boolean isBlocking()
StreamReader mode.
true, if StreamReader is operating in blocking mode, or
false otherwise.
StreamReader mode.void setBlocking(boolean isBlocking)
StreamReader mode.
isBlocking - true, if StreamReader is operating in
blocking mode, or false otherwise.
Future<Integer> flush()
throws IOException
IOException
Future<Integer> flush(CompletionHandler<Integer> completionHandler)
throws IOException
IOException
Future<Integer> close(CompletionHandler<Integer> completionHandler)
throws IOException
StreamWriter and make sure all data was flushed.
IOException
void writeBoolean(boolean data)
throws IOException
data - boolean value.
IOException
void writeByte(byte data)
throws IOException
data - byte value.
IOException
void writeChar(char data)
throws IOException
data - char value.
IOException
void writeShort(short data)
throws IOException
data - short value.
IOException
void writeInt(int data)
throws IOException
data - int value.
IOException
void writeLong(long data)
throws IOException
data - long value.
IOException
void writeFloat(float data)
throws IOException
data - float value.
IOException
void writeDouble(double data)
throws IOException
data - double value.
IOException
void writeBooleanArray(boolean[] data)
throws IOException
data - array of boolean values.
IOException
void writeByteArray(byte[] data)
throws IOException
data - array of byte values.
IOException
void writeByteArray(byte[] data,
int offset,
int length)
throws IOException
data - array of byte values.offset - array offset to start from.length - number of bytes to write.
IOException
void writeCharArray(char[] data)
throws IOException
data - array of char values.
IOException
void writeShortArray(short[] data)
throws IOException
data - array of short values.
IOException
void writeIntArray(int[] data)
throws IOException
data - array of int values.
IOException
void writeLongArray(long[] data)
throws IOException
data - array of long values.
IOException
void writeFloatArray(float[] data)
throws IOException
data - array of float values.
IOException
void writeDoubleArray(double[] data)
throws IOException
data - array of double values.
IOException
void writeBuffer(Buffer buffer)
throws IOException
Buffer to the StreamWriter.
buffer - Buffer.
IOException
void writeStream(StreamReader stream)
throws IOException
StreamReader available data to this StreamWriter
This method will make possible direct writing from StreamReader,
avoiding Buffer copying.
stream - StreamReader
IOExceptionConnection getConnection()
Connection this StreamWriter belongs to.
Connection this StreamWriter belongs to.Buffer getBuffer()
Buffer, where the StreamWriter buffers
output.
Buffer, where the StreamWriter buffers
output.int getBufferSize()
Buffer size to be used for StreamWriter
write operations.
Buffer size to be used for StreamWriter
write operations.void setBufferSize(int size)
Buffer size to be used for StreamWriter
write operations.
size - the preferred Buffer size to be used for
StreamWriter write operations.long getTimeout(TimeUnit timeunit)
timeunit - timeout unit TimeUnit.
void setTimeout(long timeout,
TimeUnit timeunit)
timeout - the timeout for StreamWriter I/O operations.timeunit - timeout unit TimeUnit.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||