private void encodeSize(ByteBuffer headerBuffer,int size){
  headerBuffer.put((byte)((size & 0x00FF0000) >> 16));
  headerBuffer.put((byte)((size & 0x0000FF00) >> 8));
  headerBuffer.put((byte)(size & 0x000000FF));
  logger.fine("Frame Size Is Actual:" + size + ":Encoded bin:"+ Integer.toBinaryString(size)+ ":Encoded Hex"+ Integer.toHexString(size));
}

private void encodeSize ( ByteBuffer headerBuffer , int size ) { headerBuffer . put ( ( byte ) ( ( size & 0x00FF0000 ) > > 16 ) ) ; headerBuffer . put ( ( byte ) ( ( size & 0x0000FF00 ) > > 8 ) ) ; headerBuffer . put ( ( byte ) ( size & 0x000000FF ) ) ; logger . fine ( "Frame Size Is Actual:" + size + ":Encoded bin:" + Integer . toBinaryString ( size ) + ":Encoded Hex" + Integer . toHexString ( size ) ) ; }
write frame size ( can now be accurately calculated , have to convert 4 byte int to 3 byte format .
