List of usage examples for org.apache.cassandra.io.util Memory setLong
public void setLong(long offset, long l)
From source file:com.fullcontact.cassandra.io.compress.CompressionMetadata.java
License:Apache License
/** * Read offsets of the individual chunks from the given input. * * @param input Source of the data.//from w w w . j a va2s .c o m * @return collection of the chunk offsets. */ private Memory readChunkOffsets(DataInput input) { try { int chunkCount = input.readInt(); Memory offsets = Memory.allocate(chunkCount * 8); for (int i = 0; i < chunkCount; i++) { try { offsets.setLong(i * 8, input.readLong()); } catch (EOFException e) { String msg = String.format("Corrupted Index File %s: read %d but expected %d chunks.", indexFilePath, i, chunkCount); throw new CorruptSSTableException(new IOException(msg, e), indexFilePath); } } return offsets; } catch (IOException e) { throw new FSReadError(e, indexFilePath); } }