org.graphstream.stream.netstream.packing
Class NetStreamPacker

java.lang.Object
  extended by org.graphstream.stream.netstream.packing.NetStreamPacker
Direct Known Subclasses:
Base64Packer

public abstract class NetStreamPacker
extends Object


Constructor Summary
NetStreamPacker()
           
 
Method Summary
 ByteBuffer packMessage(ByteBuffer buffer)
          Pack the given ByteBuffer form its position to its capacity.
abstract  ByteBuffer packMessage(ByteBuffer buffer, int startIndex, int endIndex)
          Pack the given ByteBuffer from startIndex to endIdex
abstract  ByteBuffer packMessageSize(int capacity)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetStreamPacker

public NetStreamPacker()
Method Detail

packMessage

public abstract ByteBuffer packMessage(ByteBuffer buffer,
                                       int startIndex,
                                       int endIndex)
Pack the given ByteBuffer from startIndex to endIdex

Parameters:
buffer - The buffer to pack/encode
startIndex - the index at which the encoding starts in the buffer
endIndex - the index at which the encoding stops
Returns:
a ByteBuffer that is the packed version of the input one. It may not have the same size.

packMessage

public ByteBuffer packMessage(ByteBuffer buffer)
Pack the given ByteBuffer form its position to its capacity.

Parameters:
buffer - The buffer to pack/encode
Returns:
a ByteBuffer that is the packed version of the input one. It may not have the same size.

packMessageSize

public abstract ByteBuffer packMessageSize(int capacity)
Parameters:
capacity -
Returns:


Copyright © 2012. All Rights Reserved.