test_class.file: oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/cli/blob/LoopbackBlobStoreTest.java
test_class.identifier: LoopbackBlobStoreTest
test_case.body: @Test(expected = UnsupportedOperationException.class)
      @Parameters(method = "blobIdsFailedBufferReadsCases")
      public void getInputStreamShouldAlwaysReturnExceptionIfBufferTooSmall(
              final String blobId,
              int offsetToRead,
              int bufSize,
              int bufOffset,
              int lengthToRead) throws IOException {
          given:
          {
              final BlobStore store = new LoopbackBlobStore();
              final byte[] buffer = new byte[bufSize];
              when:
              {
                  store.readBlob(
                          blobId, offsetToRead, buffer, bufOffset, lengthToRead);
              }
          }
      }
test_case.class_method_signature: LoopbackBlobStoreTest.getInputStreamShouldAlwaysReturnExceptionIfBufferTooSmall(
              final String blobId,
              int offsetToRead,
              int bufSize,
              int bufOffset,
              int lengthToRead)
test_case.full_signature: @Test(expected = UnsupportedOperationException.class) @Parameters(method = "blobIdsFailedBufferReadsCases") public void getInputStreamShouldAlwaysReturnExceptionIfBufferTooSmall(
              final String blobId,
              int offsetToRead,
              int bufSize,
              int bufOffset,
              int lengthToRead)
test_case.identifier: getInputStreamShouldAlwaysReturnExceptionIfBufferTooSmall
test_case.invocations: readBlob
test_case.modifiers: @Test(expected = UnsupportedOperationException.class) @Parameters(method = "blobIdsFailedBufferReadsCases") public
test_case.parameters: (
              final String blobId,
              int offsetToRead,
              int bufSize,
              int bufOffset,
              int lengthToRead)
test_case.return: void
test_case.signature: void getInputStreamShouldAlwaysReturnExceptionIfBufferTooSmall(
              final String blobId,
              int offsetToRead,
              int bufSize,
              int bufOffset,
              int lengthToRead)
focal_class.file: oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/cli/blob/LoopbackBlobStore.java
focal_class.identifier: LoopbackBlobStore
focal_class.interfaces: implements BlobStore
focal_class.class_method_signature: LoopbackBlobStore.writeBlob(InputStream in)
focal_class.full_signature: @Override public String writeBlob(InputStream in)
focal_class.identifier: writeBlob
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream in)
focal_class.return: String
focal_class.signature: String writeBlob(InputStream in)
focal_class.class_method_signature: LoopbackBlobStore.writeBlob(InputStream in, BlobOptions options)
focal_class.full_signature: @Override public String writeBlob(InputStream in, BlobOptions options)
focal_class.identifier: writeBlob
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream in, BlobOptions options)
focal_class.return: String
focal_class.signature: String writeBlob(InputStream in, BlobOptions options)
focal_class.class_method_signature: LoopbackBlobStore.readBlob(String blobId, long pos, byte[] buff, int off,
              int length)
focal_class.full_signature: @Override public int readBlob(String blobId, long pos, byte[] buff, int off,
              int length)
focal_class.identifier: readBlob
focal_class.modifiers: @Override public
focal_class.parameters: (String blobId, long pos, byte[] buff, int off,
              int length)
focal_class.return: int
focal_class.signature: int readBlob(String blobId, long pos, byte[] buff, int off,
              int length)
focal_class.class_method_signature: LoopbackBlobStore.checkForBufferOverflow(final byte[] buff, final int off,
                                          final int effectiveBlobLengthToBeRead)
focal_class.full_signature: private void checkForBufferOverflow(final byte[] buff, final int off,
                                          final int effectiveBlobLengthToBeRead)
focal_class.identifier: checkForBufferOverflow
focal_class.modifiers: private
focal_class.parameters: (final byte[] buff, final int off,
                                          final int effectiveBlobLengthToBeRead)
focal_class.return: void
focal_class.signature: void checkForBufferOverflow(final byte[] buff, final int off,
                                          final int effectiveBlobLengthToBeRead)
focal_class.class_method_signature: LoopbackBlobStore.checkBinaryOffsetInRange(final long pos, final int binaryLength)
focal_class.full_signature: private void checkBinaryOffsetInRange(final long pos, final int binaryLength)
focal_class.identifier: checkBinaryOffsetInRange
focal_class.modifiers: private
focal_class.parameters: (final long pos, final int binaryLength)
focal_class.return: void
focal_class.signature: void checkBinaryOffsetInRange(final long pos, final int binaryLength)
focal_class.class_method_signature: LoopbackBlobStore.getBlobIdStringAsByteArray(final String blobId)
focal_class.full_signature: private byte[] getBlobIdStringAsByteArray(final String blobId)
focal_class.identifier: getBlobIdStringAsByteArray
focal_class.modifiers: private
focal_class.parameters: (final String blobId)
focal_class.return: byte[]
focal_class.signature: byte[] getBlobIdStringAsByteArray(final String blobId)
focal_class.class_method_signature: LoopbackBlobStore.getBlobLength(String blobId)
focal_class.full_signature: @Override public long getBlobLength(String blobId)
focal_class.identifier: getBlobLength
focal_class.modifiers: @Override public
focal_class.parameters: (String blobId)
focal_class.return: long
focal_class.signature: long getBlobLength(String blobId)
focal_class.class_method_signature: LoopbackBlobStore.getInputStream(String blobId)
focal_class.full_signature: @Override public InputStream getInputStream(String blobId)
focal_class.identifier: getInputStream
focal_class.modifiers: @Override public
focal_class.parameters: (String blobId)
focal_class.return: InputStream
focal_class.signature: InputStream getInputStream(String blobId)
focal_class.class_method_signature: LoopbackBlobStore.getBlobId(@NotNull String reference)
focal_class.full_signature: @Override public String getBlobId(@NotNull String reference)
focal_class.identifier: getBlobId
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull String reference)
focal_class.return: String
focal_class.signature: String getBlobId(@NotNull String reference)
focal_class.class_method_signature: LoopbackBlobStore.getReference(@NotNull String blobId)
focal_class.full_signature: @Override public String getReference(@NotNull String blobId)
focal_class.identifier: getReference
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull String blobId)
focal_class.return: String
focal_class.signature: String getReference(@NotNull String blobId)
focal_class.class_method_signature: LoopbackBlobStore.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: @Override
      public int readBlob(String blobId, long pos, byte[] buff, int off,
              int length) {
          // Only a part of binary can be requested!
          final int binaryLength = blobId.length();
          checkBinaryOffsetInRange(pos, binaryLength);
          final int effectiveSrcPos = Math.toIntExact(pos);
          final int effectiveBlobLengthToBeRead = Math.min(
                  binaryLength - effectiveSrcPos, length);
          checkForBufferOverflow(buff, off, effectiveBlobLengthToBeRead);
          final byte[] blobIdBytes = getBlobIdStringAsByteArray(blobId);
          System.arraycopy(blobIdBytes, effectiveSrcPos, buff, off,
                  effectiveBlobLengthToBeRead);
          return effectiveBlobLengthToBeRead;
      }
focal_method.class_method_signature: LoopbackBlobStore.readBlob(String blobId, long pos, byte[] buff, int off,
              int length)
focal_method.full_signature: @Override public int readBlob(String blobId, long pos, byte[] buff, int off,
              int length)
focal_method.identifier: readBlob
focal_method.invocations: length checkBinaryOffsetInRange toIntExact min checkForBufferOverflow getBlobIdStringAsByteArray arraycopy
focal_method.modifiers: @Override public
focal_method.parameters: (String blobId, long pos, byte[] buff, int off,
              int length)
focal_method.return: int
focal_method.signature: int readBlob(String blobId, long pos, byte[] buff, int off,
              int length)