Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 249166

Re: Testing a custom PdxSerializer

$
0
0

Here is some code to serialize an object to a byte[] and deserialize it back to an object using GemFire APIs:

 

import com.gemstone.gemfire.internal.util.BlobHelper;// Serialize to byte arraybyte[] serializedValue = null;try{  serializedValue = BlobHelper.serializeToBlob(obj);}catch (IOException e) {  // fail test}// Deserialize from byte array
Object value = null;try{  value = BlobHelper.deserializeBlob(serializedValue);}catch (Exception e) {  // fail test}

Viewing all articles
Browse latest Browse all 249166

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>