예제 #1
0
 private void setRingCursor(ByteBuffer buffer, int newCursor) {
   checkArgument(newCursor >= 0);
   buffer.putInt(4, newCursor);
 }
예제 #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;
 }