This is a follow-up to #790. That ticket (and related PRs) added some methods to BufferedData, but they are not enough for real world scenarios to write data to RandomAccessData (in particular, to write objects to files in MerkleDb using mapped byte buffers / memory segments).
A few methods to add:
Bytes.putTo(RandomAccessData, offset) - to write Bytes at a given offset, similar to existing Bytes.writeTo(WritableSequentialData)
BufferedData.putTo(RandomAccessData, offset) - similar to Bytes
RandomAccessData.putBytes(offset, ByteBuffer) - similar to existing RandomAccessData.putBytes(offset, byte[]), needed to implement the above
ProtoWriterTools.putTag(RandomAccessData, offset, field) - similar to existing ProtoWriterTools.writeTag(WritableSequentialData), not strictly needed, but handy
This is a follow-up to #790. That ticket (and related PRs) added some methods to BufferedData, but they are not enough for real world scenarios to write data to RandomAccessData (in particular, to write objects to files in MerkleDb using mapped byte buffers / memory segments).
A few methods to add:
Bytes.putTo(RandomAccessData, offset)- to write Bytes at a given offset, similar to existingBytes.writeTo(WritableSequentialData)BufferedData.putTo(RandomAccessData, offset)- similar to BytesRandomAccessData.putBytes(offset, ByteBuffer)- similar to existingRandomAccessData.putBytes(offset, byte[]), needed to implement the aboveProtoWriterTools.putTag(RandomAccessData, offset, field)- similar to existingProtoWriterTools.writeTag(WritableSequentialData), not strictly needed, but handy