public final class BitFileWriter extends Object implements Closeable
Typical usage:
BitFileWriter writer = new BitFileWriter(new File("path/to/file.bit")); writer.write(bitFile); writer.close();
Constructor and Description |
---|
BitFileWriter(File file)
Create a BIT file writer for the specified disk file.
|
BitFileWriter(OutputStream outputStream)
Create a BIT file writer for the specified stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Append the final EOF TIF marker to the stream and close the
back-end stream.
|
void |
write(BitFile bitFile)
Write the specified BIT file.
|
void |
write(List<BitFile> bitFiles)
Write a list of logical BIT files to this writer.
|
public BitFileWriter(OutputStream outputStream)
outputStream
- Stream to write. Non-null.IllegalArgumentException
- If outputStream is null.public BitFileWriter(File file)
file
- Disk file to write. Non-null.IllegalArgumentException
- If file is null.public void write(BitFile bitFile) throws IOException
Multiple logical BIT files can be written in sequence to the same stream.
When writing is done, close the writer with close()
.
bitFile
- BIT file to write. Non-null.IllegalArgumentException
- If bitFile is null.IOException
- If the write operation fails for some reason.public void write(List<BitFile> bitFiles) throws IOException
write(BitFile)
in sequence.bitFiles
- BIT files to write. Non-null.IllegalArgumentException
- If bitFiles 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