Package com.streamconverter.command.impl
Class SampleStreamCommand
java.lang.Object
com.streamconverter.command.AbstractStreamCommand
com.streamconverter.command.impl.SampleStreamCommand
- All Implemented Interfaces:
IStreamCommand
SampleStreamCommand is a concrete implementation of AbstractStreamCommand.
This command reads data from an input stream and writes it to an output stream.
-
Field Summary
Fields inherited from class com.streamconverter.command.AbstractStreamCommand
log -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that initializes the command with a default ID.Constructor that initializes the command with a specific ID. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteInternal(InputStream inputStream, OutputStream outputStream) Executes the command on the provided input stream and writes the result to the output stream.toString()Methods inherited from class com.streamconverter.command.AbstractStreamCommand
execute, execute, getCommandDetails
-
Constructor Details
-
SampleStreamCommand
public SampleStreamCommand()Default constructor that initializes the command with a default ID. -
SampleStreamCommand
Constructor that initializes the command with a specific ID.- Parameters:
arg- The ID to be assigned to this command.- Throws:
NullPointerException- if arg is null
-
-
Method Details
-
executeInternal
Executes the command on the provided input stream and writes the result to the output stream.- Specified by:
executeInternalin classAbstractStreamCommand- Parameters:
inputStream- The input stream to read data from.outputStream- The output stream to write data to.- Throws:
IOException- If an I/O error occurs during the execution of the command.
-
toString
-