public long looseUnmarshalLong(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn) throws IOException { return dataIn.readLong(); }
public long looseUnmarshalLong(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn) throws IOException { return dataIn.readLong(); }
public double readDouble() throws IOException { return Double.longBitsToDouble(readLong()); }
public double readDouble() throws IOException { return Double.longBitsToDouble(readLong()); }
public double readDouble() throws IOException { return Double.longBitsToDouble(readLong()); }
void decode(Buffer buffer) throws PagingException { DataByteArrayInputStream is = new DataByteArrayInputStream(buffer); int length = readFields(is); is.setPos((FILE_HEADER_SIZE / 2) - 8); long expectedChecksum = is.readLong(); CRC32 checksum = new CRC32(); checksum.update(buffer.data, 0, length); if (checksum.getValue() != expectedChecksum) { // Try the 2nd copy.. is.setPos(FILE_HEADER_SIZE / 2); length = readFields(is); is.setPos(FILE_HEADER_SIZE - 8); expectedChecksum = is.readLong(); checksum = new CRC32(); checksum.update(buffer.data, 0, length); if (checksum.getValue() != expectedChecksum) { throw new PagingException("file header corruption detected."); } } }
void decode(Buffer buffer) throws PagingException { DataByteArrayInputStream is = new DataByteArrayInputStream(buffer); int length = readFields(is); is.setPos((FILE_HEADER_SIZE / 2) - 8); long expectedChecksum = is.readLong(); CRC32 checksum = new CRC32(); checksum.update(buffer.data, 0, length); if (checksum.getValue() != expectedChecksum) { // Try the 2nd copy.. is.setPos(FILE_HEADER_SIZE / 2); length = readFields(is); is.setPos(FILE_HEADER_SIZE - 8); expectedChecksum = is.readLong(); checksum = new CRC32(); checksum.update(buffer.data, 0, length); if (checksum.getValue() != expectedChecksum) { throw new PagingException("file header corruption detected."); } } }
private int readFields(DataByteArrayInputStream is) { is.readFully(magic); base_revision = is.readLong(); page_size = is.readInt(); free_list_page = is.readInt(); pessimistic_recovery_page = is.readInt(); optimistic_recovery_page = is.readInt(); int length = is.getPos(); return length; }
private int readFields(DataByteArrayInputStream is) { is.readFully(magic); base_revision = is.readLong(); page_size = is.readInt(); free_list_page = is.readInt(); pessimistic_recovery_page = is.readInt(); optimistic_recovery_page = is.readInt(); int length = is.getPos(); return length; }
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataByteArrayInputStream dataIn, BooleanStream bs) throws IOException { if (bs.readBoolean()) { if (bs.readBoolean()) { return dataIn.readLong(); } else { return toLong(dataIn.readInt()); } } else { if (bs.readBoolean()) { return toLong(dataIn.readShort()); } else { return 0; } } }