Created
June 27, 2018 11:35
-
-
Save galderz/4170abb6dd522ac3250989d8e842ab90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.infinispan.protostream.MessageMarshaller; | |
public class CryptoCurrencyMarshaller implements MessageMarshaller<CryptoCurrency> { | |
@Override | |
public CryptoCurrency readFrom(ProtoStreamReader reader) throws IOException { | |
String description = reader.readString("description"); | |
Integer rank = reader.readInt("rank"); | |
return new CryptoCurrency(description, rank); | |
} | |
@Override | |
public void writeTo(ProtoStreamWriter writer, CryptoCurrency obj) throws IOException { | |
writer.writeString("description", obj.description); | |
writer.writeInt("rank", obj.rank); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment