@Override public int write(OutputStream out, boolean withTags) throws IOException { return PrivateCellUtil.writeCell(cell, out, withTags); }
@Override public void serialize(Cell kv) throws IOException { dos.writeInt(PrivateCellUtil.estimatedSerializedSizeOf(kv) - Bytes.SIZEOF_INT); PrivateCellUtil.writeCell(kv, dos, true); } }
@Test public void testWriteCell() throws IOException { byte[] r = Bytes.toBytes("row1"); byte[] f = Bytes.toBytes("cf1"); byte[] q1 = Bytes.toBytes("qual1"); byte[] q2 = Bytes.toBytes("qual2"); byte[] v = Bytes.toBytes("val1"); byte[] tags = Bytes.toBytes("tag1"); KeyValue kv = new KeyValue(r, f, q1, 0, q1.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); NonExtendedCell nonExtCell = new NonExtendedCell(kv); ByteArrayOutputStream os = new ByteArrayOutputStream(); int writeCell = PrivateCellUtil.writeCell(nonExtCell, os, true); byte[] byteArray = os.toByteArray(); KeyValue res = new KeyValue(byteArray); assertTrue(CellUtil.equals(kv, res)); }
@Override public int write(OutputStream out, boolean withTags) throws IOException { return PrivateCellUtil.writeCell(cell, out, withTags); }
@Override public int write(OutputStream out, boolean withTags) throws IOException { return PrivateCellUtil.writeCell(cell, out, withTags); }
@Override public void serialize(Cell kv) throws IOException { dos.writeInt(PrivateCellUtil.estimatedSerializedSizeOf(kv) - Bytes.SIZEOF_INT); PrivateCellUtil.writeCell(kv, dos, true); } }
@Override public void serialize(Cell kv) throws IOException { dos.writeInt(PrivateCellUtil.estimatedSerializedSizeOf(kv) - Bytes.SIZEOF_INT); PrivateCellUtil.writeCell(kv, dos, true); } }
@Test public void testWriteCell() throws IOException { byte[] r = Bytes.toBytes("row1"); byte[] f = Bytes.toBytes("cf1"); byte[] q1 = Bytes.toBytes("qual1"); byte[] q2 = Bytes.toBytes("qual2"); byte[] v = Bytes.toBytes("val1"); byte[] tags = Bytes.toBytes("tag1"); KeyValue kv = new KeyValue(r, f, q1, 0, q1.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); NonExtendedCell nonExtCell = new NonExtendedCell(kv); ByteArrayOutputStream os = new ByteArrayOutputStream(); int writeCell = PrivateCellUtil.writeCell(nonExtCell, os, true); byte[] byteArray = os.toByteArray(); KeyValue res = new KeyValue(byteArray); assertTrue(CellUtil.equals(kv, res)); }
@Test public void testWriteCell() throws IOException { byte[] r = Bytes.toBytes("row1"); byte[] f = Bytes.toBytes("cf1"); byte[] q1 = Bytes.toBytes("qual1"); byte[] q2 = Bytes.toBytes("qual2"); byte[] v = Bytes.toBytes("val1"); byte[] tags = Bytes.toBytes("tag1"); KeyValue kv = new KeyValue(r, f, q1, 0, q1.length, 1234L, KeyValue.Type.Put, v, 0, v.length, tags); NonExtendedCell nonExtCell = new NonExtendedCell(kv); ByteArrayOutputStream os = new ByteArrayOutputStream(); int writeCell = PrivateCellUtil.writeCell(nonExtCell, os, true); byte[] byteArray = os.toByteArray(); KeyValue res = new KeyValue(byteArray); assertTrue(CellUtil.equals(kv, res)); }