/** * @param bytes * @return Object * @throws IOException * @throws ClassNotFoundException * */ @Override public <T> T deSerialize( byte[] bytes, ClassLoader loader ) throws IOException, ClassNotFoundException { deSerializeCount++; return serializer.deSerialize( bytes, loader ); }
/** * @param bytes * @return Object * @throws IOException * @throws ClassNotFoundException * */ @Override public <T> T deSerialize( byte[] bytes, ClassLoader loader ) throws IOException, ClassNotFoundException { deSerializeCount++; return serializer.deSerialize( bytes, loader ); }
try remoteCacheResponse = serializer.deSerialize( responseAsByteArray, null );
try remoteCacheResponse = serializer.deSerialize( responseAsByteArray, null );
/** * Test simple back and forth with a string. *<p> * @throws Exception */ public void testBigStringBackAndForth() throws Exception { // SETUP StandardSerializer serializer = new StandardSerializer(); String string = "This is my big string ABCDEFGH"; StringBuilder sb = new StringBuilder(); sb.append( string ); for ( int i = 0; i < 4; i++ ) { sb.append( " " + i + sb.toString() ); // big string } String before = sb.toString(); // DO WORK String after = (String) serializer.deSerialize( serializer.serialize( before ), null ); // VERIFY assertEquals( "Before and after should be the same.", before, after ); } }
/** * Test simple back and forth with a string. *<p> * @throws Exception */ public void testBigStringBackAndForth() throws Exception { // SETUP StandardSerializer serializer = new StandardSerializer(); String string = "This is my big string ABCDEFGH"; StringBuilder sb = new StringBuilder(); sb.append( string ); for ( int i = 0; i < 4; i++ ) { sb.append( " " + i + sb.toString() ); // big string } String before = sb.toString(); // DO WORK String after = (String) serializer.deSerialize( serializer.serialize( before ), null ); // VERIFY assertEquals( "Before and after should be the same.", before, after ); } }
/** * Test simple back and forth with a string. *<p> * @throws Exception */ public void testSimpleBackAndForth() throws Exception { // SETUP StandardSerializer serializer = new StandardSerializer(); String before = "adsfdsafdsafdsafdsafdsafdsafdsagfdsafdsafdsfdsafdsafsa333 31231"; // DO WORK String after = (String) serializer.deSerialize( serializer.serialize( before ), null ); // VERIFY assertEquals( "Before and after should be the same.", before, after ); }
/** * Test simple back and forth with a string. *<p> * @throws Exception */ public void testSimpleBackAndForth() throws Exception { // SETUP StandardSerializer serializer = new StandardSerializer(); String before = "adsfdsafdsafdsafdsafdsafdsafdsagfdsafdsafdsfdsafdsafsa333 31231"; // DO WORK String after = (String) serializer.deSerialize( serializer.serialize( before ), null ); // VERIFY assertEquals( "Before and after should be the same.", before, after ); }
Serializable result = elementSerializer.deSerialize( resultData, null );
Serializable result = elementSerializer.deSerialize(resultData, null);
/** * Test serialization with a null object. Verify that we don't get an error. *<p> * @throws Exception */ public void testNullInput() throws Exception { // SETUP StandardSerializer serializer = new StandardSerializer(); String before = null; // DO WORK byte[] serialized = serializer.serialize( before ); //System.out.println( "testNullInput " + serialized ); String after = (String) serializer.deSerialize( serialized, null ); //System.out.println( "testNullInput " + after ); // VERIFY assertNull( "Should have nothing.", after ); }
/** * Test serialization with a null object. Verify that we don't get an error. *<p> * @throws Exception */ public void testNullInput() throws Exception { // SETUP StandardSerializer serializer = new StandardSerializer(); String before = null; // DO WORK byte[] serialized = serializer.serialize( before ); //System.out.println( "testNullInput " + serialized ); String after = (String) serializer.deSerialize( serialized, null ); //System.out.println( "testNullInput " + after ); // VERIFY assertNull( "Should have nothing.", after ); }