Package org.graphstream.stream.binary
Interface ByteDecoder
- All Superinterfaces:
Source
- All Known Implementing Classes:
NetStreamDecoder
public interface ByteDecoder extends Source
Decode an event that has been encoded into a binary buffer and dispatch this
event to its sources. This is a complementary features of the event encoding
in
ByteEncoder.- Since:
- 31/01/16.
-
Method Summary
Modifier and Type Method Description voiddecode(ByteBuffer buffer)Decode the buffer, and dispatch the corresponding event.booleanvalidate(ByteBuffer buffer)Tells if the buffer contains an event that is ready to be dispatched.Methods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
-
Method Details
-
decode
Decode the buffer, and dispatch the corresponding event.- Parameters:
buffer- event as a binary buffer
-
validate
Tells if the buffer contains an event that is ready to be dispatched. The bytes considered should be from 0 to the buffer's position. The position of the buffer SHOULD NOT be changed.- Parameters:
buffer-- Returns:
- true if the buffer contains an event
-