org.springframework.core.serializer.support.DeserializingConverter Java Examples

The following examples show how to use org.springframework.core.serializer.support.DeserializingConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SerializationConverterTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void serializeAndDeserializeString() {
	SerializingConverter toBytes = new SerializingConverter();
	byte[] bytes = toBytes.convert("Testing");
	DeserializingConverter fromBytes = new DeserializingConverter();
	assertEquals("Testing", fromBytes.convert(bytes));
}
 
Example #2
Source File: SerializationConverterTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void serializeAndDeserializeString() {
	SerializingConverter toBytes = new SerializingConverter();
	byte[] bytes = toBytes.convert("Testing");
	DeserializingConverter fromBytes = new DeserializingConverter();
	assertEquals("Testing", fromBytes.convert(bytes));
}
 
Example #3
Source File: SerializationConverterTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void serializeAndDeserializeString() {
	SerializingConverter toBytes = new SerializingConverter();
	byte[] bytes = toBytes.convert("Testing");
	DeserializingConverter fromBytes = new DeserializingConverter();
	assertEquals("Testing", fromBytes.convert(bytes));
}
 
Example #4
Source File: SerializationConverterTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test(expected = SerializationFailedException.class)
public void deserializationFailure() {
	DeserializingConverter fromBytes = new DeserializingConverter();
	fromBytes.convert("Junk".getBytes());
}
 
Example #5
Source File: SerializationConverterTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Test(expected = SerializationFailedException.class)
public void deserializationFailure() {
	DeserializingConverter fromBytes = new DeserializingConverter();
	fromBytes.convert("Junk".getBytes());
}
 
Example #6
Source File: CustomJdkSerializationRedisSerializer.java    From oauth-server with Apache License 2.0 4 votes vote down vote up
public CustomJdkSerializationRedisSerializer() {
    this(new SerializingConverter(), new DeserializingConverter());
}
 
Example #7
Source File: CustomJdkSerializationRedisSerializer.java    From oauth-server with Apache License 2.0 4 votes vote down vote up
public CustomJdkSerializationRedisSerializer(ClassLoader classLoader) {
    this(new SerializingConverter(), new DeserializingConverter(classLoader));
}
 
Example #8
Source File: SerializationConverterTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test(expected = SerializationFailedException.class)
public void deserializationFailure() {
	DeserializingConverter fromBytes = new DeserializingConverter();
	fromBytes.convert("Junk".getBytes());
}
 
Example #9
Source File: SpringDevToolsSerializer.java    From wicket-spring-boot with Apache License 2.0 4 votes vote down vote up
public SpringDevToolsSerializer(){
	this.deserializer = new DeserializingConverter(new DefaultDeserializer(Thread.currentThread().getContextClassLoader()));
}
 
Example #10
Source File: JdbcIndexedSessionRepository.java    From spring-session with Apache License 2.0 4 votes vote down vote up
private static GenericConversionService createDefaultConversionService() {
	GenericConversionService converter = new GenericConversionService();
	converter.addConverter(Object.class, byte[].class, new SerializingConverter());
	converter.addConverter(byte[].class, Object.class, new DeserializingConverter());
	return converter;
}
 
Example #11
Source File: JdbcHttpSessionConfiguration.java    From spring-session with Apache License 2.0 4 votes vote down vote up
private static GenericConversionService createConversionServiceWithBeanClassLoader(ClassLoader classLoader) {
	GenericConversionService conversionService = new GenericConversionService();
	conversionService.addConverter(Object.class, byte[].class, new SerializingConverter());
	conversionService.addConverter(byte[].class, Object.class, new DeserializingConverter(classLoader));
	return conversionService;
}