hashgraph / hashgraph/pbj

Need more random access related methods

Open
#940 0 comments 0 reactions 1 assignee Claimed by @artemananiev View on GitHub
Improvement
Dominant language
Java
Stars
44
Forks
15
Avg merge
1d 15h
Merged PRs (30d)
12

Description

This is a follow-up to https://github.com/hashgraph/pbj/issues/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.