Package com.io7m.smfj.format.text
Class SMFTLineReaderStreamIO
- java.lang.Object
-
- com.io7m.smfj.format.text.SMFTLineReaderStreamIO
-
- All Implemented Interfaces:
SMFTLineReaderType
public final class SMFTLineReaderStreamIO extends java.lang.Object
A line reader based on blocking stream IO.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFTLineReaderType
create(java.net.URI in_uri, java.io.InputStream in_stream)
Construct a new line reader.java.util.Optional<java.util.List<java.lang.String>>
line()
Get the next line.protected java.lang.String
lineNextRaw()
protected org.slf4j.Logger
log()
com.io7m.jlexing.core.LexicalPosition<java.net.URI>
position()
-
-
-
Method Detail
-
create
public static SMFTLineReaderType create(java.net.URI in_uri, java.io.InputStream in_stream)
Construct a new line reader.- Parameters:
in_uri
- The file URI, for diagnostic messagesin_stream
- The input stream- Returns:
- A line reader
-
log
protected org.slf4j.Logger log()
-
lineNextRaw
protected java.lang.String lineNextRaw() throws java.io.IOException
- Throws:
java.io.IOException
-
position
public final com.io7m.jlexing.core.LexicalPosition<java.net.URI> position()
- Specified by:
position
in interfaceSMFTLineReaderType
- Returns:
- The current position
-
line
public final java.util.Optional<java.util.List<java.lang.String>> line() throws java.io.IOException
Description copied from interface:SMFTLineReaderType
Get the next line.- Specified by:
line
in interfaceSMFTLineReaderType
- Returns:
- A lexed line, or nothing on EOF
- Throws:
java.io.IOException
- On I/O errors
-
-