public static void putRange(ByteBuffer buffer,int start,int end,byte b){
  for (int i=start; i < end; ++i) {
    buffer.put(i,b);
  }
}

public static void putRange ( ByteBuffer buffer , int start , int end , byte b ) { for ( int i = start ; i < end ; ++ i ) { buffer . put ( i , b ) ; } }
sets all bytes in the given byte range to the given byte value .
