Ejemplo n.º 1
0
 private void setRingCursor(ByteBuffer buffer, int newCursor) {
   checkArgument(newCursor >= 0);
   buffer.putInt(4, newCursor);
 }
Ejemplo n.º 2
0
 /**
  * Returns the offset from the file start where the latest block should be written (end of prev
  * block).
  */
 private int getRingCursor(ByteBuffer buffer) {
   int c = buffer.getInt(4);
   checkState(c >= FILE_PROLOGUE_BYTES, "Integer overflow");
   return c;
 }