Example usage for java.io FilterWriter flush

List of usage examples for java.io FilterWriter flush

Introduction

In this page you can find the example usage for java.io FilterWriter flush.

Prototype

public void flush() throws IOException 

Source Link

Document

Flushes the stream.

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    Writer w = new StringWriter(6);

    FilterWriter fw = new FilterWriter(w) {
    };//w w  w .j  av a2 s  . c  om

    fw.write(65);

    fw.flush();

    String s = w.toString();

    System.out.print(s);
}