ome / ome/ome-common-java

Does the number of bytes read need to be used?

Open
#103 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue question
Dominant language
Java
Stars
2
Forks
19
PR merge metrics
No merged PRs in 30d

Description

https://github.com/ome/ome-common-java/blob/de268dd1acc68448508a18383cf557080d44a9dc/src/main/java/loci/common/ByteArrayHandle.java#L183-L186

Line 184 does not return the returned number of bytes read. I’m thinking this number might be needed at line 185 when populating the ByteBuffer buf. This way, buf.position() will know exactly how many bytes were read. Maybe not important/needed??

Add len = to line 184?

len = read(b);
buf.put(b, 0, len);

Below is where the number of bytes read can get modified, line 163

https://github.com/ome/ome-common-java/blob/de268dd1acc68448508a18383cf557080d44a9dc/src/main/java/loci/common/ByteArrayHandle.java#L161-L167

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 in src/main/java/loci/common/ByteArrayHandle.java around lines 161-186. Check how read(b) reports its byte count and how ByteBuffer.put affects buf.position(), including short reads. Done means the buffer position reflects the bytes actually read, with the behavior verified against the surrounding method logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.