Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Bytes.EMPTY from DirectBufferedData.readBytes() if length is zero #291

Open
poulok opened this issue Sep 30, 2024 · 0 comments
Open

Comments

@poulok
Copy link
Member

poulok commented Sep 30, 2024

Update the DirectBufferedData.readBytes(int length) method to return Bytes.EMPTY if the length of the returned Bytes objects is zero. Callers can safely check the length of the returned object today, but the PBJ library should return Bytes.EMPTY for empty instances as much as possible to enable callers to use bytes == Bytes.EMPTY as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant