1 8 9 package com.sleepycat.je.logversion; 10 11 import com.sleepycat.je.DatabaseEntry; 12 13 public class Utils { 14 15 static final String DB1_NAME = "database1"; 16 static final String DB2_NAME = "database2"; 17 static final String MIN_VERSION_NAME = "minversion.jdb"; 18 static final String MAX_VERSION_NAME = "maxversion.jdb"; 19 20 static DatabaseEntry entry(int val) { 21 22 byte[] data = new byte[] { (byte) val }; 23 return new DatabaseEntry(data); 24 } 25 26 static int value(DatabaseEntry entry) { 27 28 byte[] data = entry.getData(); 29 if (data.length != 1) { 30 throw new IllegalStateException ("len=" + data.length); 31 } 32 return data[0]; 33 } 34 } 35 | Popular Tags |