Package org.jppf.io
Class ChannelOutputDestination
java.lang.Object
org.jppf.io.ChannelOutputDestination
- All Implemented Interfaces:
Closeable,AutoCloseable,IO,OutputDestination
- Direct Known Subclasses:
FileOutputDestination
Output destination backed by a
WritableByteChannel.- Author:
- Laurent Cohen
-
Field Summary
FieldsFields inherited from interface org.jppf.io.IO
CHECK_LOW_MEMORY, EMPTY_BYTES, FREE_MEM_TO_SIZE_RATIO, GC_ON_DISK_OVERFLOW, LENGTH_BUFFER_POOL, LENGTH_BUFFER_POOL_SIZE, LOW_MEMORY_THRESHOLD, SOCKET_BUFFER_SIZE, SOCKET_KEEPALIVE, SOCKET_TCP_NODELAY, TEMP_BUFFER_POOL, TEMP_BUFFER_POOL_SIZE, TEMP_BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionInitialize this output destination with the specifiedSocketWrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This method does nothing.toString()intwrite(byte[] data, int offset, int len) Write data to this output destination from an array of bytes.intwrite(ByteBuffer data) Write data to this output destination from a byte buffer.voidwriteInt(int value) Write an int value to this output destination.
-
Field Details
-
channel
The backingWritableByteChannel.
-
-
Constructor Details
-
ChannelOutputDestination
Initialize this output destination with the specifiedSocketWrapper.- Parameters:
channel- the backingSocketWrapper.
-
-
Method Details
-
write
Write data to this output destination from an array of bytes.- Specified by:
writein interfaceOutputDestination- Parameters:
data- the buffer containing the data to write.offset- the position in the buffer where to start reading the data.len- the size in bytes of the data to write.- Returns:
- the number of bytes actually written, or -1 if end of stream was reached.
- Throws:
Exception- if an IO error occurs.
-
write
Write data to this output destination from a byte buffer.- Specified by:
writein interfaceOutputDestination- Parameters:
data- the buffer containing the data to write.- Returns:
- the number of bytes actually written, or -1 if end of stream was reached.
- Throws:
Exception- if an IO error occurs.
-
writeInt
Write an int value to this output destination.- Specified by:
writeIntin interfaceOutputDestination- Parameters:
value- the value to write.- Throws:
Exception- if an IO error occurs.
-
close
This method does nothing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an IO error occurs.
-
toString
-