45464748495051
public void testSimpleUsingByteArray() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); new SimpleVIntTrieBuilder(new MapReader(TEST_ENTRIES)).buildAndWrite(out, false); byte[] raw = out.toByteArray(); _testSimple(new ByteArrayVIntTrieLookup(raw)); }
56575859606162
* Method for constructing variable int (VInt) valued tries, using * raw byte array as is for lookup. */ public static VIntTrieLookup constructByteArrayVIntTrie(byte[] raw) { return new ByteArrayVIntTrieLookup(raw); }
132133134135136137138
{ TrieHeader header = _readHeader(in, true); int len = (int) header.getPayloadLength(); byte[] buffer = new byte[len]; InputUtil.readFully(in, buffer, 0, len); return new ByteArrayVIntTrieLookup(buffer); }