public final class OsduWellLogWriter extends Object implements Closeable
TODO
Constructor and Description |
---|
OsduWellLogWriter(File file,
String namespace)
Create a new OSDU well log writer instance for writing pretty printed content
with default (2) indentation.
|
OsduWellLogWriter(File file,
String namespace,
boolean isPretty,
int indentation)
Create a new OSDU well log writer instance.
|
OsduWellLogWriter(OutputStream outputStream,
String namespace,
boolean isPretty,
int indentation)
Create a new OSDU well log writer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Append closing brackets and close the back-end stream.
|
static void |
main(String[] arguments) |
static String |
toString(OsduWellLog log,
String namespace)
Return a pretty JSON string representation of the specified OSDU well log.
|
static String |
toString(OsduWellLog log,
String namespace,
boolean isPretty,
int indentation)
Return a JSON string representation of the specified OSDU well log.
|
void |
write(OsduWellLog log)
Write meta-data of the specified log.
|
void |
writeData(OsduWellLog log,
int fromIndex,
int toIndex,
File file)
Write log data to the specified file.
|
void |
writeData(OsduWellLog log,
int fromIndex,
int toIndex,
OutputStream stream)
Write log data to the specified stream.
|
public OsduWellLogWriter(OutputStream outputStream, String namespace, boolean isPretty, int indentation)
outputStream
- Stream to write meta-data to. Non-null.namespace
- Namespace to use for OSDU category data. Non-null.isPretty
- True to write in pretty format, falkse to write condensed.indentation
- Indentation to use for pretty format. [0,>.
If isPretty is false, this setting has no effect.IllegalArgumentException
- If outputStream or namespace is null or indentation < 0.public OsduWellLogWriter(File file, String namespace, boolean isPretty, int indentation)
file
- File to write meta-data to. Non-null.namespace
- Namespace to use for OSDU category data. Non-null.isPretty
- True to write in pretty format, falkse to write condensed.indentation
- Indentation to use for pretty format. [0,>.
If isPretty is false, this setting has no effect.IllegalArgumentException
- If file or namespace is null or indentation < 0.public OsduWellLogWriter(File file, String namespace)
file
- File to write meta-data to. Non-null.namespace
- Namespace to use for OSDU category data. Non-null.IllegalArgumentException
- If file or namespace is null.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void writeData(OsduWellLog log, int fromIndex, int toIndex, OutputStream stream) throws IOException
log
- Log to write data from. Non-null.fromIndex
- From index (included) to write. [0,NValues>.toIndex
- To index (excluded) to write. <fromIndex,NValues>.stream
- Stream to write to. Non-null.IllegalArgumentException
- If log or stream is null or fromIndex or toIndex is out of bounds.IOException
- If the write operation fails for some reason.public void writeData(OsduWellLog log, int fromIndex, int toIndex, File file) throws IOException
log
- Log to write data from. Non-null.fromIndex
- From index (included) to write. [0,NValues>.toIndex
- To index (excluded) to write. <fromIndex,NValues>.file
- File to write to. Non-null.IllegalArgumentException
- If log or file is null or fromIndex or toIndex is out of bounds.IOException
- If the write operation fails for some reason.public void write(OsduWellLog log) throws IOException
log
- Log to write. Non-null.IOException
public static String toString(OsduWellLog log, String namespace, boolean isPretty, int indentation)
log
- Log to create string from. Non-null.namespace
- OSDU namespace to use for category data. Non-null.isPretty
- True to write in human readable pretty format, false
to write as dense as possible.indentation
- The white space indentation used in pretty print mode. [0,>.
If isPretty is false, this setting has no effect.IllegalArgumentException
- If log or namespace is null, or indentation is negative.public static String toString(OsduWellLog log, String namespace)
log
- Log to create string from. Non-null.namespace
- OSDU namespace to use for category data. Non-null.IllegalArgumentException
- If log or namespace is null.Copyright © 2024 Petroware AS - https://petroware.no