Package org.appng.tools.os
Class StringConsumer
- java.lang.Object
-
- org.appng.tools.os.StringConsumer
-
- All Implemented Interfaces:
Command.StreamConsumer<List<String>>
public class StringConsumer extends Object implements Command.StreamConsumer<List<String>>
BasicStringConsumer
-implementation which reads from anInputStream
line-by-line and stores the result in aList
ofString
s.- Author:
- Matthias Müller
-
-
Constructor Summary
Constructors Constructor Description StringConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume(InputStream is)
Consumes the givenInputStream
.List<String>
getResult()
Returns the result for thisStreamConsumer
.
-
-
-
Method Detail
-
consume
public void consume(InputStream is) throws IOException
Description copied from interface:Command.StreamConsumer
Consumes the givenInputStream
.- Specified by:
consume
in interfaceCommand.StreamConsumer<List<String>>
- Parameters:
is
- theInputStream
to consume- Throws:
IOException
- if an error occurs while consuming
-
getResult
public List<String> getResult()
Description copied from interface:Command.StreamConsumer
Returns the result for thisStreamConsumer
.- Specified by:
getResult
in interfaceCommand.StreamConsumer<List<String>>
- Returns:
- the result of type
<T>
-
-