static final ByteBuffer BufferToByteBuffer(final byte[] buffer,final ByteOrder order,final int start,final int len){
  final ByteBuffer retBuff=ByteBuffer.wrap(buffer,start,len);
  retBuff.order(order);
  return retBuff;
}

static final ByteBuffer BufferToByteBuffer ( final byte [ ] buffer , final ByteOrder order , final int start , final int len ) { final ByteBuffer retBuff = ByteBuffer . wrap ( buffer , start , len ) ; retBuff . order ( order ) ; return retBuff ; }
converts a buffer to a bytebuffer with boundary constraints .
