org.jppf.io
Interface OutputDestination

All Superinterfaces:
Closeable, IO
All Known Implementing Classes:
ChannelOutputDestination, FileOutputDestination, SocketWrapperOutputDestination, StreamOutputDestination

public interface OutputDestination
extends IO

This interface represents an abstraction of any destination for outgoing data.

Author:
Laurent Cohen

Method Summary
 int write(byte[] data, int offset, int len)
          Write data to this output destination from an array of bytes.
 int write(ByteBuffer data)
          Write data to this output destination from a byte buffer.
 void writeInt(int value)
          Write an int value to this output destination.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

write

int write(byte[] data,
          int offset,
          int len)
          throws Exception
Write data to this output destination from an array of bytes.

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

int write(ByteBuffer data)
          throws Exception
Write data to this output destination from a byte buffer.

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

void writeInt(int value)
              throws Exception
Write an int value to this output destination.

Parameters:
value - the value to write.
Throws:
Exception - if an IO error occurs.


Copyright © 2005-2010 JPPF Team.