fr.boreal.io.api.Writer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of integraal-io Show documentation
Show all versions of integraal-io Show documentation
Inputs and Outputs for integraal objects
The newest version!
package fr.boreal.io.api;
import java.io.Closeable;
import java.io.IOException;
/**
* Write objects if possible
*
* @author Florent Tornil
*
*/
public interface Writer extends Closeable {
/**
* Write the given object if possible
* @param object object to write
* @throws IOException
* If an I/O error occurs
*/
void write(Object object) throws IOException;
/**
* Flush the writer if possible
* @throws IOException
* If an I/O error occurs
*/
void flush() throws IOException;
/**
* Write the given objects if possible
* @param objects objects to write
* @throws IOException
* If an I/O error occurs
*/
default void write(Object... objects) throws IOException {
for(Object o : objects) {
this.write(o);
}
}
}