Skip to content

Commit 2e1a2b6

Browse files
committed
Add optional ReadData.prefetch(...) method
The default implementation does nothing
1 parent 0c46c8e commit 2e1a2b6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/main/java/org/janelia/saalfeldlab/n5/readdata/ReadData.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.io.InputStream;
3333
import java.io.OutputStream;
3434
import java.nio.ByteBuffer;
35+
import java.util.Collection;
3536
import org.janelia.saalfeldlab.n5.N5Exception.N5IOException;
3637
import org.janelia.saalfeldlab.n5.codec.DataCodec;
3738

@@ -222,6 +223,20 @@ default void writeTo(OutputStream outputStream) throws N5IOException, IllegalSta
222223
}
223224
}
224225

226+
/**
227+
* Indicates that the given slices will be subsequently read.
228+
* {@code ReadData} implementations (optionally) may take steps to prepare
229+
* for these subsequent slices.
230+
*
231+
* @param ranges
232+
* slice ranges to prefetch
233+
*
234+
* @throws N5IOException
235+
* if any I/O error occurs
236+
*/
237+
default void prefetch(final Collection<? extends Range> ranges) throws N5IOException {
238+
}
239+
225240
// ------------- Encoding / Decoding ----------------
226241
//
227242

0 commit comments

Comments
 (0)