code: private byte[] copyOf(byte[] original, int length) {
          byte[] copy = new byte[length];
          if (length <= original.length) {
              System.arraycopy(original, 0, copy, 0, length);
          }
          else {
              System.arraycopy(original, 0, copy, 0, original.length);
          }
          return copy;
      }
docs: copyOf
  This method has pretty much the same spec as the Java 1.6 Arrays.copyOf(byte[]...)
  method, which can't be used because the Thin Client has to be able to run on v1.5.
  There is no checking or error-throwing in this method, as it is expected to be
  called only by intelligent callers!
  
  @param original The original byte array
  @param length The required length for the copy
  
  @return byte[] A copy of the original byte array, truncated or padded (with 0s)
  to the required length, if necessary.