FileDocCategorySizeDatePackage
MessageStreamDecoder.javaAPI DocAzureus 3.0.3.42476Thu Feb 09 19:43:12 GMT 2006org.gudy.azureus2.plugins.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 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(org.gudy.azureus2.plugins.network.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.