longelinebuffer.rewind();
for( int position = 2 ; ; position += 2 ) {
if( position < longelinebuffer.capacity() ) {
longelinebuffer.limit( position );
websocket.sendFragmentedFrame( Opcode.TEXT, longelinebuffer, false );// when sending binary data one should use Opcode.BINARY
assert ( longelinebuffer.remaining() == 0 );
// after calling sendFragmentedFrame one may reuse the buffer given to the method immediately
} else {
longelinebuffer.limit( longelinebuffer.capacity() );
websocket.sendFragmentedFrame( Opcode.TEXT, longelinebuffer, true );// sending the last frame