Skip to content

Improve StreamSerializer ItemStack methods#875

Merged
dmulloy2 merged 1 commit intodmulloy2:masterfrom
seyfahni:feature/byte-array-for-stream-serializer-item-stack
Jun 21, 2020
Merged

Improve StreamSerializer ItemStack methods#875
dmulloy2 merged 1 commit intodmulloy2:masterfrom
seyfahni:feature/byte-array-for-stream-serializer-item-stack

Conversation

@seyfahni
Copy link
Copy Markdown
Contributor

Reduced duplicated code and created methods for (de)serialization with byte arrays.

There are no functional changes, but two new methods:

  • byte[] serializeItemStackToByteArray(ItemStack stack) throws IOException
  • ItemStack deserializeItemStackFromByteArray(byte[] input) throws IOException

Design part:
Up till now the serialize base64 implementation did two things (serialization and base64 encoding), they are now separated.

As it is now, you don't have to use a deprecated method or encode your byte[] to base64 only to let it be decoded again.

I'm not too sure about the naming, but it should be decent.

@dmulloy2 dmulloy2 merged commit 5f204d7 into dmulloy2:master Jun 21, 2020
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

Successfully merging this pull request may close these issues.

2 participants