Reads extended medium int

@param in
Source
@return int value
491166
public final static int readExtendedMediumInt(ByteBuffer in) {
        int result = in.getInt();
        result = (result >>> 8) | ((result & 0x000000ff) << 24);
        return result;
    }
281299
private int readShort(InputStream in, CRC32 crc) throws IOException {
        int b = readByte(in, crc);
        return ((readByte(in, crc) << 8) & 0x00ff00) | b;
    }
572147
public static int readUntil (final StringBuilder out, final String in, final int start, final char... end)
  {
    int pos = start;
    while (pos < in.length ())
    {
      final char ch = in.charAt (pos);
      if (ch == '\\' && pos + 1 < in.length ())
      {
        pos = _escape (out, in.charAt (pos + 1), pos);
      }
      else
      {
        boolean endReached = false;
        for (final char element : end)
        {
          if (ch == element)
          {
            endReached = true;
            break;
          }
        }
        if (endReached)
          break;
        out.append (ch);
      }
      pos++;
    }

    return pos == in.length () ? -1 : pos;
  }
578562
protected int readFully(InputStream in, byte buffer[])
        throws java.io.IOException {
        for (int i = 0; i < buffer.length; i++) {
            int q = in.read();
            if (q == -1)
                return i;
            buffer[i] = (byte)q;
        }
        return buffer.length;
    }
1197532
public long readNBit(int n) throws IOException {
        if (n > 64)
            throw new IllegalArgumentException("Can not readByte more then 64 bit");

        long val = 0;

        for (int i = 0; i < n; i++) {
            val <<= 1;
            val |= read1Bit();
        }

        return val;
    }
1286239
private static int readLEInt(InputStream in) throws IOException {
		int i = in.read() & 0xFF;
		i |= (in.read() & 0xFF) << 8;
		i |= (in.read() & 0xFF) << 16;
		i |= (in.read() & 0xFF) << 24;
		return i;
	}
1114147
public long readLong(final int offset) throws IOException {
        final int bytesToRead = Math.max(0, offset + 8 - used);
        if (bytesToRead > 0) {
            readMore(bytesToRead);
        }
        return ((buf[offset] & 0xffL) << 56) //
                | ((buf[offset + 1] & 0xffL) << 48) //
                | ((buf[offset + 2] & 0xffL) << 40) //
                | ((buf[offset + 3] & 0xffL) << 32) //
                | ((buf[offset + 4] & 0xffL) << 24) //
                | ((buf[offset + 5] & 0xffL) << 16) //
                | ((buf[offset + 6] & 0xffL) << 8) //
                | (buf[offset + 7] & 0xffL);
    }
1347567
protected long readTerminalCount(final BitInputStream in, final long size)
    throws IOException {
    if (SERIALIZATION_CHECKS) {
      in.expect(SerializationChecks.BeforeTerminal);
    }
    final long readBoundedLong = in.readBoundedLong(1 + size);
    if (SERIALIZATION_CHECKS) {
      in.expect(SerializationChecks.AfterTerminal);
    }
    return readBoundedLong;
  }
781619
static int readInt(final byte[] b, final int index) {
        return ((b[index] & 0xFF) << 24) | ((b[index + 1] & 0xFF) << 16)
                | ((b[index + 2] & 0xFF) << 8) | (b[index + 3] & 0xFF);
    }
424064
public BigInteger readMPINT() throws IOException {
		short bits = readShort();

		byte[] raw = new byte[(bits + 7) / 8 + 1];

		raw[0] = 0;
		readFully(raw, 1, raw.length - 1);

		return new BigInteger(raw);
	}
1208949
public static int longToInt(long inLong) {

        if (inLong < Integer.MIN_VALUE) {
            return Integer.MIN_VALUE;
        }

        if (inLong > Integer.MAX_VALUE) {
            return Integer.MAX_VALUE;
        }

        return (int) inLong;
    }
1115286
private static int readFully(InputStream in, ByteArrayOutputStream bout,
            int length) throws IOException {
        int read = 0;
        byte[] buffer = new byte[2048];
        while (length > 0) {
            int n = in.read(buffer, 0, length<2048?length:2048);
            if (n <= 0) {
                break;
            }
            bout.write(buffer, 0, n);
            read += n;
            length -= n;
        }
        return read;
    }
1319937
protected final int readBytes()
        throws IOException
    {
        _inputPtr = 0;
        _inputEnd = 0;
        if (_inputSource != null) {
            int count = _inputSource.read(_inputBuffer, 0, _inputBuffer.length);
            if (count > 0) {
                _inputEnd = count;
            }
            return count;
        }
        return -1;
    }
659247
public static int readSingleByte(InputStream in) throws IOException {
        byte[] buffer = new byte[1];
        int result = in.read(buffer, 0, 1);
        return (result != -1) ? buffer[0] & 0xff : -1;
    }
805246
public final int readTTFLong() throws IOException {
        long ret = readTTFUByte();    // << 8;
        ret = (ret << 8) + readTTFUByte();
        ret = (ret << 8) + readTTFUByte();
        ret = (ret << 8) + readTTFUByte();

        return (int)ret;
    }
1024772
public int readVarInt() throws IOException {
    boolean more;
    int result = 0;
    do {
      int b = in.readUnsignedByte();
      more = (b & 0x80) == 0x80;
      result = 128 * result + (b & 0x7F);

      // TODO Check for int overflow
    } while (more);

    return result;
  }
618847
function readMPInt(der, nm) {
	assert.strictEqual(der.peek(), asn1.Ber.Integer,
	    nm + ' is not an Integer');
	return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
}