Hi,
Is it possible to write to an Oak Binary via the JCR API at an offset ?

I am asking because I am working on the Sling Upload mechanism to make it
streamable in an attempt to eliminate the many duplicate IO operations. A
whole body upload works, and depending on the DS being used shows good
improvements in speed resulting from less IO.

The Sling Chunked Upload protocol, documented at [1] generates 3x the IO
compared against a streamed upload and more compared to a non streamed
upload. IIUC the protocol was implemented in that way as the only way to
update a Binary is to re-write it from scratch with a fresh InputStream
every time.


Is there an alternative, more efficient way to achieve this that would not
require the Binary to be read from the DS, updated and written back to the
DS ?

eg
<AFAIKDoestnExist>
valueFactory.createBinary(inputStream, startingAtByteOffsetLong);

or

OutputStream binaryOutputStream = node.getOutputStream();
binaryOutputStream.seek(startingAtByteOffsetLong);
IOUtils.copy(inputStream, outputStream);
node.getSession().save();

</AFAIKDoestnExist>

The Sling issue being worked on is [2]


Best Regards
Ian

1
https://cwiki.apache.org/confluence/display/SLING/Chunked+File+Upload+Support
2 https://issues.apache.org/jira/browse/SLING-6027

Reply via email to