EntitySetup:
@Column(name = "workItemByteArray",columnDefinition = "LONGBLOB")
@Lob()
//@Convert(converter = ByteArrayToStringConverter.class)
private byte workItemByteArray;
ByteArrayInputStream binaryStream=new ByteArrayInputStream(bytes);
MarshallingConfigurationImpl marshallingConfigurationImpl = null;
marshallingConfigurationImpl = new MarshallingConfigurationImpl(new ObjectMarshallingStrategy[]{new SerializablePlaceholderResolverStrategy(ClassObjectMarshallingStrategyAcceptor.DEFAULT)}, false, false);
ObjectMarshallingStrategyStore objectMarshallingStrategyStore = marshallingConfigurationImpl.getObjectMarshallingStrategyStore();
ProtobufMarshallerReaderContext context;
WorkItem workItem=null;
try {
context = new ProtobufMarshallerReaderContext(binaryStream, null, null, objectMarshallingStrategyStore, null, null);
workItem = ProtobufInputMarshaller.readWorkItem(context);//try version1
workItem = InputMarshaller.readWorkItem(context);//try version2
//failed
} catch (Exception e) {
e.printStackTrace();
}