package it.geosolutions.io.output.adapter; import java.io.IOException; import java.io.OutputStream; import javax.imageio.stream.ImageOutputStream; /** */ public final class OutputStreamAdapter extends OutputStream { ImageOutputStream stream; public OutputStreamAdapter(ImageOutputStream stream) { super(); this.stream = stream; } public void close() throws IOException { stream.close(); } /** * Flushes this output stream and forces any buffered output bytes * to be written out. The general contract of flush is * that calling it is an indication that, if any bytes previously * written have been buffered by the implementation of the output * stream, such bytes should immediately be written to their * intended destination. *

* The flush method of OutputStream does nothing. * * @exception IOException if an I/O error occurs. */ public void flush() throws IOException { stream.flush(); } public void write(byte[] b) throws IOException { stream.write(b); } public void write(byte[] b, int off, int len) throws IOException { stream.write(b, off, len); } public void write(int b) throws IOException { stream.write(b); } }