public class InstrumentProfileReader extends Object
This reader automatically uses data formats as specified in the stream.
Modifier and Type | Class and Description |
---|---|
protected static class |
InstrumentProfileReader.UncloseableInputStream
Delegating InputStream that does not close underlying stream.
|
Constructor and Description |
---|
InstrumentProfileReader() |
Modifier and Type | Method and Description |
---|---|
long |
getLastModified()
Returns last modification time (in milliseconds) from last
readFromFile(java.lang.String) operation
or zero if it is unknown. |
protected String |
intern(String value)
To be overridden in subclasses to allow
intern strings using pools
(e.g. |
List<InstrumentProfile> |
read(InputStream in)
Reads and returns instrument profiles from specified stream.
|
List<InstrumentProfile> |
read(InputStream in,
String name)
Reads and returns instrument profiles from specified stream using specified name to select data compression format.
|
List<InstrumentProfile> |
readFromFile(String address)
Reads and returns instrument profiles from specified file.
|
static String |
resolveSourceURL(String address)
Converts a specified string address specification into an URL that will be read by
readFromFile(java.lang.String) method using URLInputStream . |
public long getLastModified()
readFromFile(java.lang.String)
operation
or zero if it is unknown.public List<InstrumentProfile> readFromFile(String address) throws IOException
This operation updates lastModified
.
address
- URL of file to read fromInstrumentProfileFormatException
- if input stream does not conform to the Simple File FormatIOException
- If an I/O error occurspublic static String resolveSourceURL(String address)
readFromFile(java.lang.String)
method using URLInputStream
.public List<InstrumentProfile> read(InputStream in, String name) throws IOException
InstrumentProfileFormatException
- if input stream does not conform to the Simple File FormatIOException
- If an I/O error occurspublic List<InstrumentProfile> read(InputStream in) throws IOException
InstrumentProfileFormatException
- if input stream does not conform to the Simple File FormatIOException
- If an I/O error occursprotected String intern(String value)
intern
strings using pools
(e.g. StringCache
) to reduce memory footprint. Default implementation does nothing
(returns value itself).value
- string value to internCopyright © 2014 Devexperts. All Rights Reserved.