flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

Incorrect Java code generation. uint8 generates int instead of byte

Open hYdos opened this issue 2 years ago • 8 comments

Yes, java uses signed bytes making the value look wrong however, the data is more accurately represented by a byte in almost every usecase. If i was storing a buffer of bytes in there, I would have to convert the array to a byte array then read it. This is an extra step which is unnecessary

hYdos avatar Aug 26 '23 22:08 hYdos

+1 for this. For comparison Cap'n'proto-java does indeed respect the bit length and outputs java byte variables. The same applies to short primitive type for uint16.

This wastes memory.

mdindoffer avatar Feb 14 '24 12:02 mdindoffer

This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

github-actions[bot] avatar Aug 14 '24 20:08 github-actions[bot]

This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

Not stale, still messed up.

mdindoffer avatar Aug 15 '24 08:08 mdindoffer

not-stale

On Thu, 15 Aug 2024 at 6:21 PM, mdindoffer @.***> wrote:

This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale, or this will be closed in 14 days.

Not stale, still messed up.

— Reply to this email directly, view it on GitHub https://github.com/google/flatbuffers/issues/8079#issuecomment-2290874439, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCR7IZQBPGL6YNVEU2KLXTZRRQIFAVCNFSM6AAAAAA373ZHGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJQHA3TINBTHE . You are receiving this because you authored the thread.Message ID: @.***>

hYdos avatar Aug 15 '24 08:08 hYdos