Reads 4 bytes from the stream and returns little-endian ordered binary
data as a 32-bit float point number as defined by IEEE 754.

@return float
@throws InvalidStreamException if an I/O error occurs
340879
final public function readFloatLE()
    {
        if ($this->isBigEndian()) {
            return $this->fromFloat(strrev($this->read(4)));
        } else {
            return $this->fromFloat($this->read(4));
        }
    }
1352937
private int readInteger() {
        int b = buf.get();
        if (buf.hasRemaining()) {
            int n = 0;
            int result = 0;
            while ((b & 0x80) != 0 && n < 3) {
                result <<= 7;
                result |= (b & 0x7f);
                b = buf.get();
                n++;
            }
            if (n < 3) {
                result <<= 7;
                result |= b;
            } else {
                // use all 8 bits from the 4th byte
                result <<= 8;
                result |= b & 0x0ff;
                // check if the integer should be negative
                if ((result & 0x10000000) != 0) {
                    // extend the sign bit
                    result |= 0xe0000000;
                }
            }
            return result;
        }
        return b;
    }
1356161
public function readFloat()
    {
        try {
            $bin = $this->getStream()->read(8);

            return current(unpack('d', $bin));
        } catch (StreamException $e) {
            $this->handleStreamException($e, BinaryStreamAccessException::FLOAT);
        }
    }
962127
protected final int readBytes()
        throws IOException
    {
        mBytePtr = 0;
        mByteBufferEnd = 0;
        if (mIn != null) {
            int count = mIn.read(mByteBuffer, 0, mByteBuffer.length);
            if (count > 0) {
                mByteBufferEnd = count;
            }
            return count;
        }
        return -1;
    }
1326321
public byte[] decodeBinary() throws IOException {
		final int length = decodeUnsignedInteger();
		byte[] result = new byte[length];

		istream.read(result, 0, length);
		return result;
	}
1018001
private boolean readHeader() {
    boolean correct = true;
    ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
    int c1 = 0;
    int c2 = 0;
    try {
      c1 = data.readByte().toInt();
      c2 = data.readByte().toInt();
    } catch (Exception ex) {
      validation.addErrorLoc("Header IO Exception", "Header");
    }

    // read the first two bytes, in order to know the byte ordering
    if (c1 == 'I' && c2 == 'I') {
      byteOrder = ByteOrder.LITTLE_ENDIAN;
    } else if (c1 == 'M' && c2 == 'M') {
      byteOrder = ByteOrder.BIG_ENDIAN;
    }
    else if (byteOrderErrorTolerance > 0 && c1 == 'i' && c2 == 'i') {
      validation.addWarning("Byte Order in lower case", "" + c1 + c2, "Header");
      byteOrder = ByteOrder.LITTLE_ENDIAN;
    } else if (byteOrderErrorTolerance > 0 && c1 == 'm' && c2 == 'm') {
      validation.addWarning("Byte Order in lower case", "" + c1 + c2, "Header");
      byteOrder = ByteOrder.BIG_ENDIAN;
    } else if (byteOrderErrorTolerance > 1) {
      validation.addWarning("Non-sense Byte Order. Trying Little Endian.", "" + c1 + c2, "Header");
      byteOrder = ByteOrder.LITTLE_ENDIAN;
    } else {
      validation.addErrorLoc("Invalid Byte Order " + c1 + c2, "Header");
      correct = false;
    }
    if (correct) {
      tiffModel.setByteOrder(byteOrder);
      data.setByteOrder(byteOrder);

      try {
        // read magic number
        int magic = data.readShort().toInt();
        tiffModel.setMagicNumber(magic);
      } catch (Exception ex) {
        validation.addErrorLoc("Magic number parsing error", "Header");
        correct = false;
      }
    }
    return correct;
  }
1287176
public int getVInt() {
		int value = 0;
		for (int i = 0; i <= 32; i += 7) {
			final byte b = getByte();
			value |= ((b & 0x7FL) << i);
			if (b >= 0)
				return value;
		}
		return value;
	}
301185
private function read()
	{
		// Ignore first byte
		fread($this->fd, 1);

		// There is also masking bit, as MSB, bit it's 0
		$payloadLength = ord(fread($this->fd, 1));

		switch ($payloadLength) {
			case 126:
				$payloadLength = unpack("n", fread($this->fd, 2));
				$payloadLength = $payloadLength[1];
				break;
			case 127:
				//$this->stdout('error', "Next 8 bytes are 64bit uint payload length, not yet implemented, since PHP can't handle 64bit longs!");
				break;
		}

		return fread($this->fd, $payloadLength);
	}
1250720
public static function getByteOrder()
	{
		if (!isset(self::$_byte_order)) {
			// Check if "pack" gives the required IEEE 64bit float
			$teststr = pack("d", 1.2345);
			$number  = pack("C8", 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F);
			if ($number == $teststr) {
				$byte_order = 0;    // Little Endian
			} elseif ($number == strrev($teststr)){
				$byte_order = 1;    // Big Endian
			} else {
				// Give up. I'll fix this in a later version.
				throw new PHPExcel_Writer_Exception("Required floating point format not supported on this platform.");
			}
			self::$_byte_order = $byte_order;
		}

		return self::$_byte_order;
	}
1018582
final public function readDoubleBE()
    {
        if ($this->isLittleEndian()) {
            return $this->fromDouble(strrev($this->read(8)));
        } else {
            return $this->fromDouble($this->read(8));
        }
    }
1083772
public int read4BE() throws OtpErlangDecodeException {
        final byte[] b = new byte[4];
        try {
            super.read(b);
        } catch (final IOException e) {
            throw new OtpErlangDecodeException("Cannot read from input stream");
        }
        return (b[0] << 24 & 0xff000000) + (b[1] << 16 & 0xff0000)
                + (b[2] << 8 & 0xff00) + (b[3] & 0xff);
    }
1149969
public int read() throws IOException {
        if (position == size) {
            return -1; // EOF
        }
        if (position < buffer.length) {
            // Convert to unsigned int.
            int c = buffer[(int) position] & 0xFF;
            position++;
            return c;
        }
        int c = diskStream.read();
        if (c >= 0) {
            position++;
        }
        return c;
    }
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;
    }
992996
public int readInt () throws KryoException {
		require(4);
		byte[] buffer = this.buffer;
		int p = this.position;
		this.position = p + 4;
		return buffer[p] & 0xFF //
			| (buffer[p + 1] & 0xFF) << 8 //
			| (buffer[p + 2] & 0xFF) << 16 //
			| (buffer[p + 3] & 0xFF) << 24;
	}
1255785
public synchronized int read() throws IOException
    {
        int b;
        if (_pos >=_avail)
            fill();
        if (_pos >=_avail)
            b=-1;
        else
            b=_buf[_pos++]&255;
        
        return b;
    }
1063380
@Override
    public Float fromBytes(Class targetClass, byte[] data)
    {
        if (data == null || data.length != 4)
            return (float) 0x0;

        return Float.intBitsToFloat(toInt(data));
    }
223773
protected function readInteger()
    {
        if ($this->littleEndian) {
            $result = unpack('Vint', fread($this->file, 4));
        } else {
            $result = unpack('Nint', fread($this->file, 4));
        }

        return $result['int'];
    }