Repository navigation
Commit c7842b0
scijava-io3: port data handles
Ports org.scijava.io.handle as org.scijava.io3.handle, plus Bytes, which
the handles need. Same standalone approach as the locations: plain
ServiceLoader, no container, scijava-collections the only dependency.
DataHandle no longer extends WrapperPlugin. That contract was small --
getType() plus set/get -- so it is inlined as locationType(), supports(),
set(), get() and priority(). Nothing else among the fifteen handle
classes needed the plugin framework.
DataHandleService becomes DataHandles, which also absorbs the static
helpers from SciJava Common's DataHandles utility class.
Two things the port made explicit:
- Discovered handles are prototypes. A handle carries the position and
buffers of one open stream, so create() must instantiate a fresh one
per call rather than hand out the discovered instance. SciJava Common
got this from WrapperService.create(); here it is explicit, with a test
asserting that two handles on one file have independent offsets.
- DataHandles.copy reported progress to a Task, which also carried
cancellation. Progress is now a plain LongConsumer of the running byte
count, so callers wanting org.scijava.progress can adapt it in a
lambda. Cancellation is therefore no longer supported by copy; if it is
wanted it should be a deliberate mechanism, not a side effect of the
progress type. Recorded as an open question in the plan.
Still to port in this component: io.nio.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gJpzGd3ksbME4CN6Tu2ni1 parent 790ec74 commit c7842b0
21 files changed
Lines changed: 4058 additions & 2 deletions
File tree
- docs
- scijava-io3/src
- main/java
- org/scijava/io3
- handle
- test/java/org/scijava/io3/handle
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
310 | 323 | | |
311 | 324 | | |
312 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
0 commit comments