public interface StreamWriter extends Stream
Modifier and Type | Method and Description |
---|---|
GrizzlyFuture<Integer> |
close(CompletionHandler<Integer> completionHandler)
Close the
StreamWriter and make sure all data was flushed. |
<E> GrizzlyFuture<Stream> |
encode(Transformer<E,Buffer> encoder,
E object) |
<E> GrizzlyFuture<Stream> |
encode(Transformer<E,Buffer> encoder,
E object,
CompletionHandler<Stream> completionHandler) |
GrizzlyFuture<Integer> |
flush()
Make sure that all data that has been written is
flushed from the stream to its destination.
|
GrizzlyFuture<Integer> |
flush(CompletionHandler<Integer> completionHandler)
Make sure that all data that has been written is
flushed from the stream to its destination.
|
Connection |
getConnection()
Get the
Connection this StreamWriter belongs to. |
long |
getTimeout(TimeUnit timeunit)
Get the timeout for StreamWriter I/O operations.
|
boolean |
isClosed()
Returns true, if StreamReader has been closed,
or false otherwise.
|
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.
|
boolean isClosed()
GrizzlyFuture<Integer> flush() throws IOException
IOException
GrizzlyFuture<Integer> flush(CompletionHandler<Integer> completionHandler) throws IOException
IOException
GrizzlyFuture<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
<E> GrizzlyFuture<Stream> encode(Transformer<E,Buffer> encoder, E object) throws IOException
IOException
<E> GrizzlyFuture<Stream> encode(Transformer<E,Buffer> encoder, E object, CompletionHandler<Stream> completionHandler) throws IOException
IOException
Connection getConnection()
Connection
this StreamWriter belongs to.getConnection
in interface Stream
Connection
this StreamWriter belongs to.long getTimeout(TimeUnit timeunit)
timeunit
- timeout unit TimeUnit
.Copyright © 2014 Oracle Corporation. All rights reserved.