Skip to content

Incorrect starting offset while wrapping Memory onto byte array #178

@LakshSingla

Description

@LakshSingla

Memory.java#L198, permalink seems incorrect.
It initializes the memory with the offset 0, instead of the supplied offset into the array. I might be unclear on the method's contract, but this seems counterintuitive to what I was expecting - an offset of x with length l as an argument means that the memory would be a window into the [x..x+l] bytes of the provided byte array. This is what ByteBuffer.wrap() does.

Is this the expected behavior of the method or is it a bug?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions