cloudevents / cloudevents/sdk-java

Replace byte[] in getData() with ByteBuffer?

Open
#207 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement
Dominant language
Java
Stars
446
Forks
172
PR merge metrics
No merged PRs in 30d

Description

ByteBuffers gives a great deal of flexibility (they can be allocated in and off heap). If allocated outside the heap, they give a huge perf boost and, if allocated in the heap, they have more or less the same cost of a byte[].

Replacing byte[] will require changing the MessageReader and MessageWriter interfaces too, together with all the impls

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing getData() and the MessageReader and MessageWriter interfaces, then identify all implementations affected by the proposed type change. Review the API implications of using ByteBuffer, including heap and off-heap allocation, and finish when the interfaces and every implementation consistently reflect the agreed design.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.