hashgraph / hashgraph/pbj

Add UTF8 String support to Readable/WritableSequentialData implementations

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
44
Forks
15
Avg merge
1d 15h
Merged PRs (30d)
12

Description

### Problem

Currently PBJ uses a mixture of code to work on UTF8 Strings in binary data. None of them have direct access to stored data so work via read/writeByte methods and hence will be slow. See `com.hedera.pbj.runtime.Utf8Tools`.

### Solution

Add UTF8 read write methods to `ReadableSequentialData` and `WritableSequentialData` implementations. Replace Utf8Tools usage with new methods. Is there a faster method than `new String(bytes,StandardCharsets.UTF_8);` used in `com.hedera.pbj.runtime.ProtoParserTools#readString`.

See https://github.com/real-logic/agrona and https://github.com/OpenHFT/Chronicle-Bytes for ideas for fast tricks.

We need to stay very compatible to Google Protobuf interpretation of UTF8, so we are byte and byte compatible.

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.