- java.lang.Object
-
- com.github.akurilov.commons.io.TextStreamInput
-
- All Implemented Interfaces:
Input<java.lang.String>,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
TextFileInput
public class TextStreamInput extends java.lang.Object implements Input<java.lang.String>
The input implementation designed to read the text lines from the given input stream usingBufferedReader
-
-
Constructor Summary
Constructors Constructor Description TextStreamInput(java.io.InputStream input)TextStreamInput(java.io.InputStream input, int buffSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.Stringget()Get next itemintget(java.util.List<java.lang.String> buffer, int limit)Get some linesvoidreset()Most probably will cause an IOExceptionlongskip(long count)Skips characters instead of lines
-
-
-
Method Detail
-
get
public java.lang.String get() throws java.io.EOFException, java.io.IOExceptionDescription copied from interface:InputGet next item
-
get
public int get(java.util.List<java.lang.String> buffer, int limit) throws java.io.IOExceptionGet some lines- Specified by:
getin interfaceInput<java.lang.String>- Parameters:
buffer- buffer for the text lineslimit- max count of the text lines to put into the buffer- Returns:
- the count of the text lines was got
- Throws:
java.io.EOFException- if no item available morejava.io.IOException- if failed to get some-why
-
skip
public long skip(long count) throws java.io.IOExceptionSkips characters instead of lines
-
reset
public void reset() throws java.io.IOExceptionMost probably will cause an IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-