public class CRDParser extends Object
It supports both 1.0 and 2.0 versions
Note: Not all the records are read by the parser. Only the most significants are parsed. Contributions are welcome to support more fields in the format.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CRD_SUPPORTED_NAMES
Default supported files name pattern for CRD files.
|
Constructor and Description |
---|
CRDParser()
Default constructor.
|
CRDParser(TimeScale utc)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TimeScale |
getTimeScale()
Get the time scale used to read the file.
|
CRDFile |
parse(BufferedReader reader,
String fileName)
Parse a CRD file from a stream.
|
CRDFile |
parse(InputStream stream)
Parse a CRD file from an input stream using the UTF-8 charset.
|
CRDFile |
parse(String fileName)
Parse an CRD file from a file on the local file system.
|
public static final String DEFAULT_CRD_SUPPORTED_NAMES
@DefaultDataContext public CRDParser()
This constructor uses the default data context
.
public CRDParser(TimeScale utc)
utc
- utc time scale to read epochspublic TimeScale getTimeScale()
public CRDFile parse(InputStream stream) throws IOException
This method creates a BufferedReader
from the stream and as such this
method may read more data than necessary from stream
and the additional
data will be lost. The other parse methods do not have this issue.
stream
- to read the CRD file from.IOException
- if stream
throws one.parse(String)
,
parse(BufferedReader, String)
public CRDFile parse(String fileName) throws IOException
fileName
- path to the CRD file.IOException
- if one is thrown while opening or reading from fileName
public CRDFile parse(BufferedReader reader, String fileName) throws IOException
reader
- containing the CRD file.fileName
- to use in error messages.IOException
- if reader
throws one.Copyright © 2002-2020 CS GROUP. All rights reserved.