FileDocCategorySizeDatePackage
MessageStreamDecoder.javaAPI DocAzureus 3.0.3.42758Fri Jun 16 10:25:16 BST 2006com.aelitis.azureus.core.peermanager.messaging

MessageStreamDecoder

public interface MessageStreamDecoder
Decodes a message stream into separate messages.

Fields Summary
Constructors Summary
Methods Summary
public java.nio.ByteBufferdestroy()
Destroy this decoder, i.e. perform cleanup.

return
any bytes already-read and still remaining within the decoder

public intgetDataBytesDecoded()
Get the number of (piece) data bytes decoded from the transport, from the last decode op.

return
number of data bytes received

public intgetPercentDoneOfCurrentMessage()
Get the percentage of the current message that has already been received (read from the transport).

return
percentage complete (0-99), or -1 if no message is currently being received

public intgetProtocolBytesDecoded()
Get the number of protocol (overhead) bytes decoded from the transport, from the last decode op.

return
number of protocol bytes recevied

public voidpauseDecoding()
Pause message decoding.

public intperformStreamDecode(com.aelitis.azureus.core.networkmanager.Transport transport, int max_bytes)
Decode message stream from the given transport.

param
transport to decode from
param
max_bytes to decode/read from the stream
return
number of bytes decoded
throws
IOException on decoding error

public Message[]removeDecodedMessages()
Get the messages decoded from the transport, if any, from the last decode op.

return
decoded messages, or null if no new complete messages were decoded

public voidresumeDecoding()
Resume message decoding.