entry.getValue().write(dataOut);
value.write(blockWriter); entries++;
@Override public void write(final DataOutput out) throws IOException { if (!merged) { byte[] combinedBytes = new byte[getSize() + 4]; System.arraycopy(value, 0, combinedBytes, 4, getSize()); combinedBytes[0] = (byte) (kvCount >>> 24); combinedBytes[1] = (byte) (kvCount >>> 16); combinedBytes[2] = (byte) (kvCount >>> 8); combinedBytes[3] = (byte) (kvCount); value = combinedBytes; merged = true; } super.write(out); }
/** * Serialize the group, key, and value */ @Override public void write(final DataOutput out) throws IOException { group.write(out); key.write(out); value.write(out); }
private void writeObject(ObjectOutputStream out) throws IOException { key.write(out); new Value(value, false).write(out); }
protected void consume() throws IOException { digest.reset(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); if (!this.source.hasTop()) { this.topKey = null; this.topValue = null; return; } Key lastKeySeen = null; while (this.source.hasTop()) { baos.reset(); Key currentKey = this.source.getTopKey(); lastKeySeen = currentKey; currentKey.write(dos); this.source.getTopValue().write(dos); digest.update(baos.toByteArray()); this.source.next(); } this.topKey = lastKeySeen; this.topValue = new Value(digest.digest()); }
entry.getValue().write(dataOut);
try { entry.getKey().write(out); entry.getValue().write(out); } catch (Exception e) { log.error("Error writing {}", entry, e);
entry.getValue().write(dataOut);
value.write(blockWriter); entries++;