code: public static double parseFloat(InputStream inputStream, final int size) throws IOException {
          byte[] buffer = new byte[size];
          int numberOfReadsBytes = inputStream.read(buffer, 0, size);
          assert numberOfReadsBytes == size;
  
          ByteBuffer byteBuffer = ByteBuffer.wrap(buffer).order(ByteOrder.BIG_ENDIAN);
          if (8 == size) {
              return byteBuffer.getDouble();
          }
  
          return byteBuffer.getFloat();
      }
docs: method used to parse float and double
  
  @param inputStream
  - stream to get value
  @param size
  - size of the value in bytes
  @return - parsed value as double
  @throws IOException
  - in case of IO error