Class MessagingUtil
java.lang.Object
com.biglybt.core.peermanager.messaging.MessagingUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MapconvertBencodedByteStreamToPayload(DirectByteBuffer stream, int min_size, String id) Convert the given bencoded byte stream into a message map.static DirectByteBufferconvertPayloadToBencodedByteStream(Map payload, byte alloc_id) Convert the given message payload map to a bencoded byte stream.
-
Constructor Details
-
MessagingUtil
public MessagingUtil()
-
-
Method Details
-
convertPayloadToBencodedByteStream
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.
-