com.sun.grizzly.tcp
Interface FileOutputBuffer

All Known Implementing Classes:
AsynchronousOutputBuffer, GrizzlyOutputBuffer, SocketChannelOutputBuffer, SSLAsyncOutputBuffer, SSLOutputBuffer

public interface FileOutputBuffer

Simple marker class for supporting OS level send-file functionality.

Author:
oleksiys

Method Summary
 boolean isSupportFileSend()
          Returns true, if OutputBuffer supports file-send mode, or false otherwise.
 long sendFile(FileChannel fileChannel, long position, long length)
          Transfers data from file channel to the socket channel directly.
 

Method Detail

isSupportFileSend

boolean isSupportFileSend()
Returns true, if OutputBuffer supports file-send mode, or false otherwise.

Returns:
true, if OutputBuffer supports file-send mode, or false otherwise.

sendFile

long sendFile(FileChannel fileChannel,
              long position,
              long length)
              throws IOException
Transfers data from file channel to the socket channel directly.

Parameters:
fileChannel - FileChannel
position - The position within the file at which the transfer is to begin; must be non-negative
length - The maximum number of bytes to be transferred; must be non-negative
Returns:
number of bytes tranferred
Throws:
IOException


Copyright © 2012 Oracle Corporation. All Rights Reserved.