LimeWire Consolidated API

com.limegroup.gnutella.dime
Class AsyncDimeParser

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

public class AsyncDimeParser
extends ReadState

Parser for creating DIMERecords from non-blocking input. See: http://www.gotdotnet.com/team/xml_wsspecs/dime/dime.htm (or http://www.perfectxml.com/DIME.asp ) for information about DIME.


Constructor Summary
AsyncDimeParser()
           
 
Method Summary
 long getAmountProcessed()
          Returns the amount of data that has been processed by this IOState.
 List<DIMERecord> getRecords()
           
protected  boolean processRead(ReadableByteChannel channel, 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

AsyncDimeParser

public AsyncDimeParser()
Method Detail

processRead

protected boolean processRead(ReadableByteChannel channel,
                              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

getRecords

public List<DIMERecord> getRecords()

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.