Package com.c1games.terminal.algo.io
Class TerminatedStringReader
java.lang.Object
com.c1games.terminal.algo.io.TerminatedStringReader
- All Implemented Interfaces:
java.lang.AutoCloseable
public class TerminatedStringReader
extends java.lang.Object
implements java.lang.AutoCloseable
A reader of framed strings from an inputstream.
-
Constructor Summary
Constructors Constructor Description TerminatedStringReader(java.io.InputStream in, char terminator)
-
Method Summary
Modifier and Type Method Description java.lang.String
await()
Blocking, non-nullable.java.lang.String
awaitTimeout(long timeout)
Nullable, blocking, timeouts.void
close()
java.lang.String
receive()
Nullable, non-blocking.
-
Constructor Details
-
TerminatedStringReader
public TerminatedStringReader(java.io.InputStream in, char terminator)
-
-
Method Details
-
receive
public java.lang.String receive() throws java.io.IOExceptionNullable, non-blocking.- Throws:
java.io.IOException
-
await
public java.lang.String await() throws java.io.IOExceptionBlocking, non-nullable.- Throws:
java.io.IOException
-
awaitTimeout
public java.lang.String awaitTimeout(long timeout) throws java.io.IOExceptionNullable, blocking, timeouts.- Throws:
java.io.IOException
-
close
public void close() throws java.lang.Exception- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-