test_class.declarator: rnd = new Random()
test_class.modifier: private
test_class.original_string: private Random rnd = new Random();
test_class.type: Random
test_class.var_name: rnd
test_class.declarator: root = EMPTY_NODE
test_class.modifier: private
test_class.original_string: private NodeState root = EMPTY_NODE;
test_class.type: NodeState
test_class.var_name: root
test_class.declarator: builder = root.builder()
test_class.modifier: private
test_class.original_string: private NodeBuilder builder = root.builder();
test_class.type: NodeBuilder
test_class.var_name: builder
test_class.declarator: fileSize = 1000 + rnd.nextInt(1000)
test_class.modifier: private
test_class.original_string: private int fileSize = 1000 + rnd.nextInt(1000);
test_class.type: int
test_class.var_name: fileSize
test_class.declarator: fileCreateMode
test_class.modifier: private final
test_class.original_string: private final FileCreateMode fileCreateMode;
test_class.type: FileCreateMode
test_class.var_name: fileCreateMode
test_class.declarator: blobFactoryMode
test_class.modifier: private final
test_class.original_string: private final BlobFactoryMode blobFactoryMode;
test_class.type: BlobFactoryMode
test_class.var_name: blobFactoryMode
test_class.declarator: modeDependantBlobFactory
test_class.modifier: private final
test_class.original_string: private final ModeDependantBlobFactory modeDependantBlobFactory;
test_class.type: ModeDependantBlobFactory
test_class.var_name: modeDependantBlobFactory
test_class.file: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/OakStreamingIndexFileTest.java
test_class.identifier: OakStreamingIndexFileTest
test_case.body: @Test
      public void readSanity() throws Exception {
          byte[] fileBytes = writeFile();
  
          NodeBuilder fooBuilder = builder.child("foo");
          try (OakStreamingIndexFile readFile = new OakStreamingIndexFile("foo", fooBuilder, "dirDetails",
                  modeDependantBlobFactory.getNodeBuilderBlobFactory(fooBuilder))
          ) {
              byte[] readBytes = new byte[fileBytes.length];
              readFile.readBytes(readBytes, 0, fileBytes.length);
  
              assertEquals("Must read same amount of data", fileBytes.length, readBytes.length);
              assertTrue("Must get back same data", Arrays.equals(readBytes, fileBytes));
  
              try {
                  readFile.readBytes(readBytes, 0, 1);
                  fail("Must not be able to read past stored number of bytes");
              } catch (Exception ignored) {
                  // ignore
              }
          }
      }
test_case.class_method_signature: OakStreamingIndexFileTest.readSanity()
test_case.full_signature: @Test public void readSanity()
test_case.identifier: readSanity
test_case.invocations: writeFile child getNodeBuilderBlobFactory readBytes assertEquals assertTrue equals readBytes fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void readSanity()
focal_class.declarator: LOG = LoggerFactory.getLogger(OakStreamingIndexFile.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(OakStreamingIndexFile.class.getName());
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: name
focal_class.modifier: private final
focal_class.original_string: private final String name;
focal_class.type: String
focal_class.var_name: name
focal_class.declarator: file
focal_class.modifier: private final
focal_class.original_string: private final NodeBuilder file;
focal_class.type: NodeBuilder
focal_class.var_name: file
focal_class.declarator: position = 0
focal_class.modifier: private
focal_class.original_string: private long position = 0;
focal_class.type: long
focal_class.var_name: position
focal_class.declarator: length
focal_class.modifier: private
focal_class.original_string: private long length;
focal_class.type: long
focal_class.var_name: length
focal_class.declarator: blob
focal_class.modifier: private
focal_class.original_string: private Blob blob;
focal_class.type: Blob
focal_class.var_name: blob
focal_class.declarator: blobModified = false
focal_class.modifier: private
focal_class.original_string: private boolean blobModified = false;
focal_class.type: boolean
focal_class.var_name: blobModified
focal_class.declarator: blobInputStream
focal_class.modifier: private
focal_class.original_string: private InputStream blobInputStream;
focal_class.type: InputStream
focal_class.var_name: blobInputStream
focal_class.declarator: uniqueKey
focal_class.modifier: private final
focal_class.original_string: private final byte[] uniqueKey;
focal_class.type: byte[]
focal_class.var_name: uniqueKey
focal_class.declarator: dirDetails
focal_class.modifier: private final
focal_class.original_string: private final String dirDetails;
focal_class.type: String
focal_class.var_name: dirDetails
focal_class.declarator: blobFactory
focal_class.modifier: private final
focal_class.original_string: private final BlobFactory blobFactory;
focal_class.type: BlobFactory
focal_class.var_name: blobFactory
focal_class.file: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/OakStreamingIndexFile.java
focal_class.identifier: OakStreamingIndexFile
focal_class.interfaces: implements OakIndexFile, AutoCloseable
focal_class.class_method_signature: OakStreamingIndexFile.OakStreamingIndexFile(String name, NodeBuilder file, String dirDetails,
                            @NotNull BlobFactory blobFactory)
focal_class.full_signature:   OakStreamingIndexFile(String name, NodeBuilder file, String dirDetails,
                            @NotNull BlobFactory blobFactory)
focal_class.identifier: OakStreamingIndexFile
focal_class.parameters: (String name, NodeBuilder file, String dirDetails,
                            @NotNull BlobFactory blobFactory)
focal_class.signature:  OakStreamingIndexFile(String name, NodeBuilder file, String dirDetails,
                            @NotNull BlobFactory blobFactory)
focal_class.class_method_signature: OakStreamingIndexFile.OakStreamingIndexFile(OakStreamingIndexFile that)
focal_class.full_signature: private  OakStreamingIndexFile(OakStreamingIndexFile that)
focal_class.identifier: OakStreamingIndexFile
focal_class.modifiers: private
focal_class.parameters: (OakStreamingIndexFile that)
focal_class.signature:  OakStreamingIndexFile(OakStreamingIndexFile that)
focal_class.class_method_signature: OakStreamingIndexFile.setupInputStream()
focal_class.full_signature: private void setupInputStream()
focal_class.identifier: setupInputStream
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setupInputStream()
focal_class.class_method_signature: OakStreamingIndexFile.releaseInputStream()
focal_class.full_signature: private void releaseInputStream()
focal_class.identifier: releaseInputStream
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void releaseInputStream()
focal_class.class_method_signature: OakStreamingIndexFile.clone()
focal_class.full_signature: @Override public OakIndexFile clone()
focal_class.identifier: clone
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: OakIndexFile
focal_class.signature: OakIndexFile clone()
focal_class.class_method_signature: OakStreamingIndexFile.length()
focal_class.full_signature: @Override public long length()
focal_class.identifier: length
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long length()
focal_class.class_method_signature: OakStreamingIndexFile.position()
focal_class.full_signature: @Override public long position()
focal_class.identifier: position
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long position()
focal_class.class_method_signature: OakStreamingIndexFile.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_class.class_method_signature: OakStreamingIndexFile.isClosed()
focal_class.full_signature: @Override public boolean isClosed()
focal_class.identifier: isClosed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isClosed()
focal_class.class_method_signature: OakStreamingIndexFile.seek(long pos)
focal_class.full_signature: @Override public void seek(long pos)
focal_class.identifier: seek
focal_class.modifiers: @Override public
focal_class.parameters: (long pos)
focal_class.return: void
focal_class.signature: void seek(long pos)
focal_class.class_method_signature: OakStreamingIndexFile.readBytes(byte[] b, int offset, int len)
focal_class.full_signature: @Override public void readBytes(byte[] b, int offset, int len)
focal_class.identifier: readBytes
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] b, int offset, int len)
focal_class.return: void
focal_class.signature: void readBytes(byte[] b, int offset, int len)
focal_class.class_method_signature: OakStreamingIndexFile.writeBytes(final byte[] b, final int offset, final int len)
focal_class.full_signature: @Override public void writeBytes(final byte[] b, final int offset, final int len)
focal_class.identifier: writeBytes
focal_class.modifiers: @Override public
focal_class.parameters: (final byte[] b, final int offset, final int len)
focal_class.return: void
focal_class.signature: void writeBytes(final byte[] b, final int offset, final int len)
focal_class.class_method_signature: OakStreamingIndexFile.supportsCopyFromDataInput()
focal_class.full_signature: @Override public boolean supportsCopyFromDataInput()
focal_class.identifier: supportsCopyFromDataInput
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean supportsCopyFromDataInput()
focal_class.class_method_signature: OakStreamingIndexFile.copyBytes(DataInput input, final long numBytes)
focal_class.full_signature: @Override public void copyBytes(DataInput input, final long numBytes)
focal_class.identifier: copyBytes
focal_class.modifiers: @Override public
focal_class.parameters: (DataInput input, final long numBytes)
focal_class.return: void
focal_class.signature: void copyBytes(DataInput input, final long numBytes)
focal_class.class_method_signature: OakStreamingIndexFile.pushData(InputStream in)
focal_class.full_signature: private void pushData(InputStream in)
focal_class.identifier: pushData
focal_class.modifiers: private
focal_class.parameters: (InputStream in)
focal_class.return: void
focal_class.signature: void pushData(InputStream in)
focal_class.class_method_signature: OakStreamingIndexFile.readUniqueKey(NodeBuilder file)
focal_class.full_signature: private static byte[] readUniqueKey(NodeBuilder file)
focal_class.identifier: readUniqueKey
focal_class.modifiers: private static
focal_class.parameters: (NodeBuilder file)
focal_class.return: byte[]
focal_class.signature: byte[] readUniqueKey(NodeBuilder file)
focal_class.class_method_signature: OakStreamingIndexFile.flush()
focal_class.full_signature: @Override public void flush()
focal_class.identifier: flush
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void flush()
focal_class.class_method_signature: OakStreamingIndexFile.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: OakStreamingIndexFile.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_method.body: @Override
      public void readBytes(byte[] b, int offset, int len)
              throws IOException {
          checkPositionIndexes(offset, offset + len, checkNotNull(b).length);
  
          if (len < 0 || position + len > length) {
              String msg = String.format("Invalid byte range request for [%s][%s], " +
                      "position: %d, file length: %d, len: %d", dirDetails, name, position, length, len);
              releaseInputStream();
              throw new IOException(msg);
          }
  
          setupInputStream();
          int readCnt = ByteStreams.read(blobInputStream, b, offset, len);
          if (readCnt < len) {
              String msg = String.format("Couldn't read byte range request for [%s][%s], " +
                      "position: %d, file length: %d, len: %d. Actual read bytes %d",
                      dirDetails, name, position, length, len, readCnt);
              releaseInputStream();
              throw new IOException(msg);
          }
  
          position += len;
      }
focal_method.class_method_signature: OakStreamingIndexFile.readBytes(byte[] b, int offset, int len)
focal_method.full_signature: @Override public void readBytes(byte[] b, int offset, int len)
focal_method.identifier: readBytes
focal_method.invocations: checkPositionIndexes checkNotNull format releaseInputStream setupInputStream read format releaseInputStream
focal_method.modifiers: @Override public
focal_method.parameters: (byte[] b, int offset, int len)
focal_method.return: void
focal_method.signature: void readBytes(byte[] b, int offset, int len)