com.aelitis.azureus.core.peermanager.messaging
Class MessagingUtil
java.lang.Object
com.aelitis.azureus.core.peermanager.messaging.MessagingUtil
public class MessagingUtil
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessagingUtil
public MessagingUtil()
convertPayloadToBencodedByteStream
public static DirectByteBuffer convertPayloadToBencodedByteStream(Map payload,
byte alloc_id)
- Convert the given message payload map to a bencoded byte stream.
- Parameters:
payload
- to convert
- Returns:
- bencoded serialization
convertBencodedByteStreamToPayload
public static Map convertBencodedByteStreamToPayload(DirectByteBuffer stream,
int min_size,
String id)
throws MessageException
- Convert the given bencoded byte stream into a message map.
- Parameters:
stream
- to convertmin_size
- of streamid
- of message
- Returns:
- mapped deserialization
- Throws:
MessageException
- on convertion error
NOTE: Does not auto-return given direct buffer on thrown exception.