We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0a30f1 commit 63cf9dcCopy full SHA for 63cf9dc
src/main/java/org/scijava/io/handle/DataHandle.java
@@ -123,7 +123,11 @@ default String checksum() throws IOException {
123
*/
124
void seek(long pos) throws IOException;
125
126
- /** Returns the length of the data in bytes. */
+ /**
127
+ * Returns the length of the data in bytes.
128
+ *
129
+ * @return The length, or -1 if the length is unknown.
130
+ */
131
long length() throws IOException;
132
133
/**
src/main/java/org/scijava/io/handle/FileHandle.java
@@ -103,7 +103,7 @@ public long offset() throws IOException {
103
104
@Override
105
public long length() throws IOException {
106
- return raf().length();
+ return exists() ? raf().length() : -1;
107
}
108
109
0 commit comments