code: private BigInteger bigForBytes(byte[] bytes, int sigbytes)
      {
          byte[] b;
          if (sigbytes != bytes.length)
          {
              b = new byte[sigbytes];
              System.arraycopy(bytes, 0, b, 0, bytes.length);
          } else
              b = bytes;
          return new BigInteger(1, b);
      }
docs: Convert a byte array containing the most significant of 'sigbytes' bytes
  representing a big-endian magnitude into a BigInteger.