Hi there,
Were you ever able to resolve this problem?
I having the same problem and I am not using RMI. Basically, I am using
almost the exact same code to persist the binary property. I can verify
that the property is persisted properly because if I retrieve the node back
(in another thread), the property looks fine. However, after the initial
call of save() on the node, if I try to retrieve the property from the same
instance of the node, the stream has 0 bytes.
Perhaps it's a bug with using ByteArrayInputStream?
zagarol wrote:
>
> Hi,
>
> I have a property on a node called 'blobData' this property has been
> loaded
> using the following snippet:
>
> ValueFactory factory = session.getValueFactory();
> Value value = factory.createValue(new ByteArrayInputStream(data));
> node.setProperty(propertyName, value);
>
> Then obviously further on a call to session.save(); is used to persist
> this.
>
> I am now trying to get this binary information back from the property
> using:
>
> InputStream inputStream = node.getProperty(property)
> .getStream();
> int readInt = 0;
> while ((readInt = inputStream.read()) >= 0) {
> outputStream.write(readInt);
> }
> return outputStream.toByteArray();
>
> However this always returns an empty byte array as the first call to
> inputStream.read() returns -1 indicating the end of the stream.
>
> Could someone point me in the direction of my error.
>
> Thanks,
> Shane.
>
>
--
View this message in context:
http://www.nabble.com/Pulling-binary-data-from-a-property-tf2423182.html#a8657674
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.