Package org.moeaframework.util.io
Interface IOCallback<T>
- Type Parameters:
T
- the type of the stream, reader, writer, or input object
- All Known Subinterfaces:
InputStreamCallback
,OutputStreamCallback
,PrintStreamCallback
,ReaderCallback
,WriterCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback function used for an I/O operation.
-
Method Summary
-
Method Details
-
accept
Invokes this callback with the given stream, reader, writer, or object.When dealing with a stream, reader, or writer, any resources are automatically closed when the callback returns. Thus, the callback itself does not need close the stream. However, the callback should throw an exception if the operation failed and needs to be aborted.
- Parameters:
stream
- the stream, reader, or writer- Throws:
IOException
- if an I/O error occurred
-