Java 8 FilterWriter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 FilterWriter class.

This code example shows how to use the following methods:write
 
        fw = new MyFilterWriter(new OutputStreamWriter(
            new ByteArrayOutputStream()));
 
        try { 
            fw.write(buffer, 0, -1);
            fail("Test 1: IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
 
        try { 
            fw.write(buffer, -1, 1);
            fail("Test 2: IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
 
        try { 
            fw.write(buffer, 10, 1);

5
CodeRank
This code example shows how to use the following methods:write
    public void write(String value)
    { 
        try 
        { 
            if (!bufferWrite)
                out.write(value);
            else 
                builder.append(value);
        } 
        catch (IOException e)
        { 
            throw new RuntimeException(e);
        } 
    } 
 
    protected String getIndent(int numIndent)
    { 
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < numIndent; i++)
            sb.append(ASEmitterTokens.INDENT.getToken());
4
CodeRank
See Code Examples for Java 8 FilterWriter Methods: