droolsjbpm/drools — pull request #176 by magnusvojbacke (2013-02-07 16:24:49+00:00)
Title: [DROOLS-25] Add option to preload unmarshallstream before parsing header

Protobuf enforces a size limit for messages when unmarshalling from a stream.

see: https://issues.jboss.org/issues/DROOLS-25

When you marshall a large knowledge base in Drools, the messages tend to become huge. It then becomes impossible to later unmarshall them.

However, when you unmarshall Protobuf messages from a byte array, the message size limit is not enforced by Protobuf.

As a workaround the size limitation impact on Drools, I've added the option to first preload the source stream into a byte array when unmarshalling a knowledge base.

I added the option as a static public boolean field in the ProtobufInputMarshaller class. The function is specific to the protobuf marshalling implementation. I can't see any place for it in any of the more generic classes or interfaces.