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

Add a optional parameter for MessagePackSerializer to determine whether compress the serialized data. #119

Merged
merged 2 commits into from
Jan 25, 2018

Conversation

edwardmeng
Copy link
Contributor

Fix the issue #118


public MessagePackSerializer(IFormatterResolver resolver = null) {
public MessagePackSerializer(IFormatterResolver resolver = null, bool compressEnabled = false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be called useCompression ? or should we have a serializer settings class for this (do we see more options being used here)?

}

public object Deserialize(Stream input, Type objectType) {
return MessagePack.MessagePackSerializer.NonGeneric.Deserialize(objectType, input, _formatterResolver);
if (_compressEnabled) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a side note, I need to work on coding style guide but we try to have single statements not have braces and K&R coding style (everything on same line } else {

@niemyjski
Copy link
Member

Looks good, only had a question about the parameter.

@niemyjski niemyjski merged commit 0b30ad3 into FoundatioFx:master Jan 25, 2018
@niemyjski
Copy link
Member

Thanks for the PR!

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