Class MessagingUtil
- java.lang.Object
-
- com.biglybt.core.peermanager.messaging.MessagingUtil
-
public class MessagingUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MessagingUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map
convertBencodedByteStreamToPayload(DirectByteBuffer stream, int min_size, java.lang.String id)
Convert the given bencoded byte stream into a message map.static DirectByteBuffer
convertPayloadToBencodedByteStream(java.util.Map payload, byte alloc_id)
Convert the given message payload map to a bencoded byte stream.
-
-
-
Method Detail
-
convertPayloadToBencodedByteStream
public static DirectByteBuffer convertPayloadToBencodedByteStream(java.util.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 java.util.Map convertBencodedByteStreamToPayload(DirectByteBuffer stream, int min_size, java.lang.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.
-
-