private RevObject decode(CacheKey key, byte[] val) { try { return encoder.read(key.id(), val, 0, val.length); } catch (IOException e) { throw new RuntimeException(e); } }
private RevObject decode(CacheKey key, byte[] val) { try { return encoder.read(key.id(), val, 0, val.length); } catch (IOException e) { throw new RuntimeException(e); } }
public @Test void testCreate() { CacheKey k1 = CacheKey.create(0, id1); CacheKey k2 = CacheKey.create(Byte.MAX_VALUE + 1, id1); assertTrue(k1 instanceof SmallKey); assertTrue(k2 instanceof BigKey); assertEquals(0, k1.prefix()); assertEquals(Byte.MAX_VALUE + 1, k2.prefix()); assertEquals(id1, k1.id()); assertEquals(id1, k2.id()); }