Skip to content

Does the number of bytes read need to be used? #103

@scuniff

Description

@scuniff

byte[] b = new byte[len];
read(b);
buf.put(b, 0, len);
return len;

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

public int read(byte[] b, int off, int len) throws IOException {
if (getFilePointer() + len > length()) {
len = (int) (length() - getFilePointer());
}
buffer.get(b, off, len);
return len;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions