code: protected byte[] copyOf(byte[] original, int newLength) {
  
          byte[] copy = new byte[newLength];
  
          System.arraycopy(original, 0, copy, 0,
                           Math.min(original.length, newLength));
  
          return copy;
      }
docs: Retrieves a copy of <tt>original</tt> with the given
  <tt>newLength</tt>. <p>
  
  @param original the object to copy
  @param newLength the length of the copy
  @return copy of <tt>original</tt> with the given <tt>newLength</tt>