public final class DlisFileWriter extends Object implements Closeable
Typical usage:
If there is to much data to keep in memory, or the writing is based on a streaming source, it is possible to append chunks of data to the last DlisFile instance written, like:DlisFileWriter writer = new DlisFiledWriter(new File("path/to/file.dlis")); writer.write(dlisFile); writer.close();
DlisFileWriter writer = new DlisFiledWriter(new File("path/to/file.dlis")); writer.write(dlisFile); writer.append(dlisFrame); writer.append(dlisFrame); : writer.close();
Constructor and Description |
---|
DlisFileWriter(File file)
Create a DLIS file writer for the specified disk file.
|
DlisFileWriter(OutputStream outputStream)
Create a DLIS file writer for the specified stream.
|
Modifier and Type | Method and Description |
---|---|
void |
append(DlisFrame dlisFrame)
Append the curve data of the specified DLIS frame.
|
void |
close()
Close the back-end stream.
|
void |
write(DlisFile dlisFile)
Write the specified DLIS file.
|
void |
write(List<DlisFile> dlisFiles)
Write the specified DLIS files.
|
public DlisFileWriter(OutputStream outputStream)
outputStream
- Stream to write. Non-null.IllegalArgumentException
- If outputStream is null.public DlisFileWriter(File file)
file
- Disk file to write. Non-null.IllegalArgumentException
- If file is null.public void write(DlisFile dlisFile) throws IOException
Multiple logical DLIS files can be written in sequence to the same stream.
When writing is done, close the writer with close()
.
dlisFile
- DLIS file to write. Non-null.IllegalArgumentException
- If dlisFile is null.IOException
- If the write operation fails for some reason.public void append(DlisFrame dlisFrame) throws IOException
This feature can be used to stream data to a DLIS file. By repeatedly clearing and populating the frame curves with new data there is no need for the client to keep the full volume in memory at any point in time.
NOTE: This method should be called after the DLIS meta data has been written to file, and the DLIS frame must be compatible with this.
dlisFrame
- DLIS frame of curves to append to file. Non-null.IllegalArgumentException
- If dlisFrame is null.IOException
- If the write operation fails for some reason.public void write(List<DlisFile> dlisFiles) throws IOException
write(DlisFile)
in sequence.dlisFiles
- DLIS files to write. Non-null.IllegalArgumentException
- If dlisFiles is null.IOException
- If the write operation fails for some reason.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2024 Petroware AS - https://petroware.no