LimeWire Consolidated API

com.limegroup.gnutella.dime
Class AsyncDimeRecordReader

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

public class AsyncDimeRecordReader
extends ReadState


Constructor Summary
AsyncDimeRecordReader()
           
 
Method Summary
 long getAmountProcessed()
          Returns the amount of data that has been processed by this IOState.
 DIMERecord getRecord()
          Returns the next record if it can be constructed or null if it isn't processed yet.
protected  boolean processRead(ReadableByteChannel rc, ByteBuffer buffer)
          Reads data from the channel into the buffer.
 
Methods inherited from class org.limewire.nio.statemachine.ReadState
isReading, isWriting, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncDimeRecordReader

public AsyncDimeRecordReader()
Method Detail

getRecord

public DIMERecord getRecord()
                     throws DIMEException
Returns the next record if it can be constructed or null if it isn't processed yet.

Returns:
Throws:
IOException
DIMEException

processRead

protected boolean processRead(ReadableByteChannel rc,
                              ByteBuffer buffer)
                       throws IOException
Description copied from class: ReadState
Reads data from the channel into the buffer. If this returns true, the state requires further processing. This should be called repeatedly until it returns false, at which point the next state should be used.

Specified by:
processRead in class ReadState
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.