code: @Override
    public double readDouble() throws IOException {
      long doubleAsLong = readLong();
      if ((doubleAsLong >>> 63) > 0) {
        doubleAsLong ^= 0x7FFFFFFFFFFFFFFFL;
      }
      return Double.longBitsToDouble(doubleAsLong);
    }
docs: A double was written as 8 bytes. It was encoded as a 64 bit long. If it was
  a negative number, the complement of the 63 bits (every bit except the sign
  bit) was taken.
  
  To decode, we read the 8 byte long. If the most significant bit is 1, we
  take the compliment of the lower 63 bits. Finally we convert this double to
  long using Double.longBitsToDouble.
  
  @return The decoded double.