Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-1331

MicroKernel API: clarify semantics of `read` method

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      the javadoc of MicroKernel#read currently states that

      An attempt is made to read as many as length bytes, but a smaller number may be read.

      under what conditions a smaller amount might be read is not specified.

      with the current specification an api consumer would either have to know the length of the blob in advance (i.e. by calling MicroKernel#getLength) or would need to call the MicroKernel#read method twice to make sure that the blob content is fully read.

      i suggest to clarify the contract as follows:

      Reads up to length bytes of data from the specified blob into the given array of bytes where the actual number of bytes read is min(length, max(0, blobLength - pos)).

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              stefan@jira Stefan Guggisberg
              Reporter:
              stefan@jira Stefan Guggisberg

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment