LimeWire Consolidated API

com.limegroup.gnutella.dime
Class AsyncDimeWriter

java.lang.Object
  extended by org.limewire.nio.statemachine.WriteState
      extended by com.limegroup.gnutella.dime.AsyncDimeWriter
All Implemented Interfaces:
IOState

public class AsyncDimeWriter
extends WriteState

Uses NIO to write a list of DIMERecord objects to a channel. Based on MessageWriter.


Field Summary
 boolean isFirstRecord
           
 
Constructor Summary
AsyncDimeWriter(List<DIMERecord> records)
           
 
Method Summary
 long getAmountProcessed()
          Returns the amount of data that has been processed by this IOState.
protected  boolean processWrite(WritableByteChannel channel, ByteBuffer buffer)
           
 
Methods inherited from class org.limewire.nio.statemachine.WriteState
isReading, isWriting, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isFirstRecord

public boolean isFirstRecord
Constructor Detail

AsyncDimeWriter

public AsyncDimeWriter(List<DIMERecord> records)
Method Detail

processWrite

protected boolean processWrite(WritableByteChannel channel,
                               ByteBuffer buffer)
                        throws IOException
Specified by:
processWrite in class WriteState
Throws:
IOException

getAmountProcessed

public long getAmountProcessed()
Description copied from interface: IOState
Returns the amount of data that has been processed by this IOState. This operation is optional; it should return -1 if unsupported.

Returns:

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.