Re: Simple serialize/deserialize test using DataSerializers

2018-03-07 Thread Darrel Schneider
BlobHelper ends up calling DataSerializer.writeObject. The nice thing about
BlobHelper is can
call org.apache.geode.internal.util.BlobHelper.serializeToBlob(Object)
and org.apache.geode.internal.util.BlobHelper.deserializeBlob(byte[])
without needing to write any of your own code the create the input and
output streams.


On Wed, Mar 7, 2018 at 11:40 AM, Dan Smith  wrote:

> DataSerializer.writeObject, if you want a public API.
>
> -Dan
>
> On Wed, Mar 7, 2018 at 11:20 AM, Anthony Baker  wrote:
>
> > BlobHelper?
> >
> > > On Mar 7, 2018, at 10:13 AM, Kirk Lund  wrote:
> > >
> > > Does anyone know what Geode API(s) I should use instead of Apache Geode
> > > SerializationUtils to change the following test to use Geode
> > > DataSerializers?
> > >
> > > @Test
> > > public void serializesAndDeserializes() throws Exception {
> > >  PartitionRegionConfig config = new PartitionRegionConfig(prId, path,
> > > partitionAttributes, scope, evictionAttributes, regionIdleTimeout,
> > > regionTimeToLive, entryIdleTimeout, entryTimeToLive, gatewaySenderIds);
> > >  byte[] bytes = SerializationUtils.serialize(config);
> > >  assertThat(bytes).isNotNull().isNotEmpty();
> > >
> > > assertThat(SerializationUtils.deserialize(bytes)).isNotSameAs(config).
> > isInstanceOf(PartitionRegionConfig.class);
> > > }
> >
> >
>


Re: Simple serialize/deserialize test using DataSerializers

2018-03-07 Thread Dan Smith
DataSerializer.writeObject, if you want a public API.

-Dan

On Wed, Mar 7, 2018 at 11:20 AM, Anthony Baker  wrote:

> BlobHelper?
>
> > On Mar 7, 2018, at 10:13 AM, Kirk Lund  wrote:
> >
> > Does anyone know what Geode API(s) I should use instead of Apache Geode
> > SerializationUtils to change the following test to use Geode
> > DataSerializers?
> >
> > @Test
> > public void serializesAndDeserializes() throws Exception {
> >  PartitionRegionConfig config = new PartitionRegionConfig(prId, path,
> > partitionAttributes, scope, evictionAttributes, regionIdleTimeout,
> > regionTimeToLive, entryIdleTimeout, entryTimeToLive, gatewaySenderIds);
> >  byte[] bytes = SerializationUtils.serialize(config);
> >  assertThat(bytes).isNotNull().isNotEmpty();
> >
> > assertThat(SerializationUtils.deserialize(bytes)).isNotSameAs(config).
> isInstanceOf(PartitionRegionConfig.class);
> > }
>
>