|
| DlisFileReader (FileInfo file) |
| Create a DLIS file reader for the specified disk file.
|
|
| DlisFileReader (Stream inputStream) |
| Create a DLIS file reader for the specified stream.
|
|
IList< DlisFile > | Read (bool shouldReadBulkData=true, bool shouldCaptureStatistics=false, IDlisDataListener dataListener=null, bool isGrowing=false) |
| Read all DLIS files from the disk file of this reader.
|
|
void | ReadData (IList< DlisFile > dlisFiles, bool shouldCaptureStatistics=false, IDlisDataListener dataListener=null, bool isGrowing=false) |
| Read data from a set of DLIS files where the meta data has already been read.
|
|
Class for reading DLIS files.
Typical usage:
DlisFileReader reader = new DlisFileReader(new FileInfo("path/to/file"));
IList<DlisFile> dlisFiles = reader.Read(true, false, null);
If the curve data is not needed, it is possible to read only the meta-data from the disk file. The curve data may be filled in later:
DlisFileReader reader = new DlisFileReader(new FileInfo("path/to/file"));
IList<DlisFile> dlisFiles = reader.Read(false);
:
reader.ReadData(dlisFiles);
Note that even if only meta-data is read, all frames and curve information are properly established as this information comes from meta-data. Only the curve values will be missing.
If disk files are larger than physical memory, it is possible to stream (process than throw away) the data during read. See IDlisDataListener. The same mechanism may be use to be able to abort the reading process during the operation.
- See also
- RP66 V1
- Author
- Petroware AS
static double IsDlisFile |
( |
FileInfo | file, |
|
|
byte[] | content = null ) |
|
static |
Get the probability that the specified file is a DLIS file.
The check can be done with or without considering the content of the file. In the latter case, only the file name (typically its extension) is considered. In the former case a portion from the start of the file is used to match for known patterns. By passing the portion as an argument, the client code can read this once and then pass it to different classifiers in order to determine its most likely type.
Getting a portion of a file can be done by:
FileInfo file = ...;
BinaryReader reader = new BinaryReader(file.OpenRead());
byte[] content = new byte[2000]; //say
reader.Read(content, 0, content.Length);
reader.Close();
- Parameters
-
file | File to check. Null to classify on content only. |
content | A number of bytes from the start of the file. Null to classify on file name only. |
- Returns
- Probability that the file is a DLIS file. [0.0,1.0].
void ReadData |
( |
IList< DlisFile > | dlisFiles, |
|
|
bool | shouldCaptureStatistics = false, |
|
|
IDlisDataListener | dataListener = null, |
|
|
bool | isGrowing = false ) |
Read data from a set of DLIS files where the meta data has already been read.
This will preserve the existing DlisFile structure in case a DLIS file is read in two operations:
// Read meta data
IList<DlisFile> dlisFiles = reader.Read(false);
// Read the curve data
reader.ReadData(dlisFiles);
There is nothing to gain in performance with this approach so in case the result is not cached, the following is equivalent:
// Read meta data
List<DlisFile> dlisFiles = reader.Read(false);
// Read the curve data
dlisFiles = reader.Read(true);
- Parameters
-
dlisFiles | The DLIS files to populate. These must be the exact same list as retrieved by calling the Read(false,...) on the same DlisFileReader instance. Otherwise the behavior is unpredictable. |
shouldCaptureStatistics | True to capture statistics per curve during read. Statistics capture will reduce read performance slightly, so set this to false if the statistics are not needed. |
dataListener | Listener that will be notified when new data has been read. Null if not used. |
isGrowing | Indicates that the file is live and might be growing, so keep the process running until the stream is closed by the client. |
- Exceptions
-
ArgumentNullException | If dlisFiles is null. |
IOException | If the read operation fails for some reason. |
OperationCanceledException | If the client returns false from the IDlisDataListener.DataRead method. |