public long readVLong() throws IOException {
		/*
		 * This is the original code of this method, but a Hotspot bug (see
		 * LUCENE-2975) corrupts the for-loop if readByte() is inlined. So the
		 * loop was unwinded! byte b = readByte(); long i = b & 0x7F; for (int
		 * shift = 7; (b & 0x80) != 0; shift += 7) { b = readByte(); i |= (b &
		 * 0x7FL) << shift; } return i;
		 */
		byte b = readByte();
		if (b >= 0)
			return b;
		long i = b & 0x7FL;
		b = readByte();
		i |= (b & 0x7FL) << 7;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 14;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 21;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 28;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 35;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 42;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 49;
		if (b >= 0)
			return i;
		b = readByte();
		i |= (b & 0x7FL) << 56;
		if (b >= 0)
			return i;
		throw new IOException(
				"Invalid vLong detected (negative values disallowed)");
	}