java.io

Interface Flushable

Known Implementing Classes:
Base64.OutputStream, BodyContent, BufferedOutputStream, BufferedWriter, ByteArrayOutputStream, ByteArrayOutputStream, ByteBuffer, CallbackWriter, CharArrayWriter, CheckedOutputStream, ChunkedOutputStream, ClosedOutputStream, CloseShieldOutputStream, CountingOnlyOutputStream, CountingOutputStream, DataOutputStream, DeferredFileOutputStream, DeflaterOutputStream, DemuxOutputStream, DigestOutputStream, DocumentOutputStream, DotTerminatedMessageWriter, FastByteArrayOutputStream, FileBufferedOutputStream, FileOutputStream, FileOutputStreamProxy, FileWriter, FileWriterWithEncoding, FilterOutputStream, FilterServletOutputStream, FilterWriter, Formatter, FromNetASCIIOutputStream, GZIPOutputStream, JarOutputStream, JRAbstractLRUVirtualizer.ClassLoaderAnnotationObjectOutputStream, JRPdfExporter.NullOutputStream, JspWriter, LockableFileWriter, LogStream, MonitorOutputStream, NullOutputStream, NullWriter, ObjectOutputStream, OutputStream, OutputStreamCounter, OutputStreamEncryption, OutputStreamWriter, PipedOutputStream, PipedWriter, PortletServletOutputStream, PrintStream, PrintWriter, PropertiesConfiguration.PropertiesWriter, ProxyOutputStream, ProxyWriter, RamFileOutputStream, ResponseStream, ResponseWriter, RubyOutputStream, ServletOutputStream, SlowOutputStream, SocketOutputStream, StringWriter, StrutsBodyContent, StrutsMockBodyContent, StrutsMockJspWriter, TeeOutputStream, ThresholdingOutputStream, ToNetASCIIOutputStream, Writer, XMLFormatter, ZipOutputStream

public interface Flushable

A Flushable is a destination of data that can be flushed. The flush method is invoked to write any buffered output to the underlying stream.
Since:
1.5

Method Summary

void
flush()
Flushes this stream by writing any buffered output to the underlying stream.

Method Details

flush

public void flush()
            throws IOException
Flushes this stream by writing any buffered output to the underlying stream.
Throws:
IOException - If an I/O error occurs
Usages and Demos :

View More Examples of flush()
   1: import java.io.IOException;
   2: import java.io.Flushable;
   3: import java.io.OutputStream;
   4:         ...
   5: 
   6:     public static void flush(Flushable flushable) throws IOException {
   7:         if (flushable instanceof OutputStream) {
   8:         ...
   9:             ((OutputStream) flushable).flush();
  10:         } else if (flushable instanceof Writer) {
  11:         ...
  12:             ((Writer) flushable).flush();

View Full Code Here
   1: import java.io.Closeable;
   2: import java.io.Flushable;
   3: import java.io.IOException;
   4:         ...
   5:   
   6:   public static IOException tryFlush(Flushable a)
   7:   {
   8:         ...
   9:       {
  10:         a.flush();
  11:       }

View Full Code Here
   1: import java.io.FileOutputStream;
   2: import java.io.Flushable;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private Flushable toBeFlushed;
   7:     private Closeable toBeClosed;
   8:         ...
   9:             try {
  10:                 toBeFlushed.flush();
  11:             } catch (IOException e) {

View Full Code Here
   1: import java.io.FileOutputStream;
   2: import java.io.Flushable;
   3: import java.io.IOException;
   4:         ...
   5:             out.writeObject(obj);    
   6:             out.flush();
   7:         } finally {
   8:         ...
   9:             os.write(data);
  10:             os.flush();
  11:         } catch(IOException bad) {
  12:         ...
  13:     
  14:     public static void flush(Flushable flushable) {

View Full Code Here