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

Improve StreamSerializer ItemStack methods #875

Conversation

seyfahni
Copy link

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.

None yet

2 participants