diff options
Diffstat (limited to 'opendc-format')
| -rw-r--r-- | opendc-format/src/main/kotlin/org/opendc/format/util/LocalInputFile.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/opendc-format/src/main/kotlin/org/opendc/format/util/LocalInputFile.kt b/opendc-format/src/main/kotlin/org/opendc/format/util/LocalInputFile.kt index d8c25a62..92319ace 100644 --- a/opendc-format/src/main/kotlin/org/opendc/format/util/LocalInputFile.kt +++ b/opendc-format/src/main/kotlin/org/opendc/format/util/LocalInputFile.kt @@ -25,6 +25,7 @@ package org.opendc.format.util import org.apache.parquet.io.InputFile import org.apache.parquet.io.SeekableInputStream import java.io.EOFException +import java.io.File import java.nio.ByteBuffer import java.nio.channels.FileChannel import java.nio.file.Path @@ -39,6 +40,11 @@ public class LocalInputFile(private val path: Path) : InputFile { */ private val channel = FileChannel.open(path, StandardOpenOption.READ) + /** + * Construct a [LocalInputFile] for the specified [file]. + */ + public constructor(file: File) : this(file.toPath()) + override fun getLength(): Long = channel.size() override fun newStream(): SeekableInputStream = object : SeekableInputStream() { |
