Search in sources :

Example 1 with FilterWriter

use of java.io.FilterWriter in project guava by google.

the class TestCharSink method openStream.

@Override
public Writer openStream() throws IOException {
    // using TestByteSink's output stream to get option behavior, so flush to it on every write
    return new FilterWriter(new OutputStreamWriter(byteSink.openStream(), UTF_8)) {

        @Override
        public void write(int c) throws IOException {
            super.write(c);
            flush();
        }

        @Override
        public void write(char[] cbuf, int off, int len) throws IOException {
            super.write(cbuf, off, len);
            flush();
        }

        @Override
        public void write(String str, int off, int len) throws IOException {
            super.write(str, off, len);
            flush();
        }
    };
}
Also used : FilterWriter(java.io.FilterWriter) OutputStreamWriter(java.io.OutputStreamWriter)

Example 2 with FilterWriter

use of java.io.FilterWriter in project j2objc by google.

the class OldFilterWriterTest method test_ConstructorLjava_io_Writer.

public void test_ConstructorLjava_io_Writer() {
    FilterWriter myWriter = null;
    called = true;
    try {
        myWriter = new MyFilterWriter(null);
        fail("NullPointerException expected.");
    } catch (NullPointerException e) {
    // expected
    }
}
Also used : FilterWriter(java.io.FilterWriter)

Example 3 with FilterWriter

use of java.io.FilterWriter in project robovm by robovm.

the class OldFilterWriterTest method test_ConstructorLjava_io_Writer.

public void test_ConstructorLjava_io_Writer() {
    FilterWriter myWriter = null;
    called = true;
    try {
        myWriter = new MyFilterWriter(null);
        fail("NullPointerException expected.");
    } catch (NullPointerException e) {
    // expected
    }
}
Also used : FilterWriter(java.io.FilterWriter)

Aggregations

FilterWriter (java.io.FilterWriter)3 OutputStreamWriter (java.io.OutputStreamWriter)1