org.apache.http.impl.nio.codecs
Class IdentityEncoder

java.lang.Object
  extended by org.apache.http.impl.nio.codecs.AbstractContentEncoder
      extended by org.apache.http.impl.nio.codecs.IdentityEncoder
All Implemented Interfaces:
ContentEncoder, FileContentEncoder

public class IdentityEncoder
extends AbstractContentEncoder
implements FileContentEncoder


Field Summary
 
Fields inherited from class org.apache.http.impl.nio.codecs.AbstractContentEncoder
completed
 
Constructor Summary
IdentityEncoder(java.nio.channels.WritableByteChannel channel)
           
 
Method Summary
 java.lang.String toString()
           
 int write(java.nio.ByteBuffer src)
          Writes a portion of entity content to the underlying channel.
 long write(java.nio.channels.FileChannel filechannel, long position, long count)
          Transfers a portion of entity content from the given file channel to the underlying network channel.
 
Methods inherited from class org.apache.http.impl.nio.codecs.AbstractContentEncoder
assertNotCompleted, complete, isCompleted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.http.nio.ContentEncoder
complete, isCompleted
 

Constructor Detail

IdentityEncoder

public IdentityEncoder(java.nio.channels.WritableByteChannel channel)
Method Detail

write

public int write(java.nio.ByteBuffer src)
          throws java.io.IOException
Description copied from interface: ContentEncoder
Writes a portion of entity content to the underlying channel.

Specified by:
write in interface ContentEncoder
Parameters:
src - The buffer from which content is to be retrieved
Returns:
The number of bytes read, possibly zero
Throws:
java.io.IOException - if I/O error occurs while writing content

write

public long write(java.nio.channels.FileChannel filechannel,
                  long position,
                  long count)
           throws java.io.IOException
Description copied from interface: FileContentEncoder
Transfers a portion of entity content from the given file channel to the underlying network channel.

Specified by:
write in interface FileContentEncoder
Parameters:
filechannel - the source FileChannel to transfer data from.
position - The position within the file at which the transfer is to begin; must be non-negative
count - The maximum number of bytes to be transferred; must be non-negative
Returns:
The number of bytes, possibly zero, that were actually transferred
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.