1 8 9 package com.sleepycat.je.dbi; 10 11 import java.nio.ByteBuffer ; 12 13 19 public class Operation { 20 21 public static final Operation PUT = new Operation((byte) 1); 22 public static final Operation NO_OVERWRITE = new Operation((byte) 2); 23 public static final Operation PLACEHOLDER = new Operation((byte) 3); 24 25 private byte op; 26 27 private Operation(byte op) { 28 this.op = op; 29 } 30 31 35 public void writeToBuffer(ByteBuffer buffer) { 36 buffer.put(op); 37 } 38 39 public void readFromBuffer(ByteBuffer buffer) { 40 op = buffer.get(); 41 } 42 } 43 | Popular Tags |