Projects >> hudson >>d971be137c531f2d2e02e5afd2c2da6f4ab0744e

Chunk
Conflicting content
     * of {@link ConsoleAnnotator}.
     */
    public void encodeTo(OutputStream out) throws IOException {
<<<<<<< HEAD
        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(new GZIPOutputStream(buf));
        oos.writeObject(this);
        oos.close();

        ByteArrayOutputStream buf2 = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(new Base64OutputStream(buf2,true,-1,null));
        dos.writeInt(buf.size());
        buf.writeTo(dos);
        dos.close();

        // atomically write to the final output, to minimize the chance of something else getting in between the output.
        // even with this, it is still technically possible to get such a mix-up to occur (for example,
        // if Java program is reading stdout/stderr separately and copying them into the same final stream.)
        byte[] buf3 = buf2.toByteArray(),
               buf4 = new byte[PREAMBLE.length + buf3.length + POSTAMBLE.length];
        System.arraycopy(PREAMBLE, 0, buf4, 0, PREAMBLE.length);
        System.arraycopy(buf3, 0, buf4, PREAMBLE.length, buf3.length);
        System.arraycopy(POSTAMBLE, 0, buf4, PREAMBLE.length + buf3.length, POSTAMBLE.length);
        out.write(buf4);
=======
        // atomically write to the final output, to minimize the chance of something else getting in between the output.
        // even with this, it is still technically possible to get such a mix-up to occur (for example,
        // if Java program is reading stdout/stderr separately and copying them into the same final stream.)
        out.write(encodeToBytes().toByteArray());
>>>>>>> 607ea34e7e96e64003193b0c0ff9967132467be0
    }

    /**
Solution content
     * of {@link ConsoleAnnotator}.
     */
    public void encodeTo(OutputStream out) throws IOException {
        // atomically write to the final output, to minimize the chance of something else getting in between the output.
        // even with this, it is still technically possible to get such a mix-up to occur (for example,
        // if Java program is reading stdout/stderr separately and copying them into the same final stream.)
        out.write(encodeToBytes().toByteArray());
    }

    /**
File
ConsoleNote.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Variable
Chunk
Conflicting content
        out.write(encodeToBytes().toString());
    }
     * encoding is ASCII compatible.
     */
    public void encodeTo(Writer out) throws IOException {
<<<<<<< HEAD
=======
    private ByteArrayOutputStream encodeToBytes() throws IOException {
>>>>>>> 607ea34e7e96e64003193b0c0ff9967132467be0
        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(new GZIPOutputStream(buf));
        oos.writeObject(this);
Solution content
     * encoding is ASCII compatible.
     */
    public void encodeTo(Writer out) throws IOException {
        out.write(encodeToBytes().toString());
    }

    private ByteArrayOutputStream encodeToBytes() throws IOException {
        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(new GZIPOutputStream(buf));
        oos.writeObject(this);
File
ConsoleNote.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Method signature
Chunk
Conflicting content
        dos.writeInt(buf.size());
        buf.writeTo(dos);
        dos.close();
<<<<<<< HEAD

        out.write(PREAMBLE_STR + encoded.toString() + POSTAMBLE_STR);
=======
        buf2.write(POSTAMBLE);
        return buf2;
>>>>>>> 607ea34e7e96e64003193b0c0ff9967132467be0
    }

    /**
Solution content
        dos.writeInt(buf.size());
        buf.writeTo(dos);
        dos.close();
        buf2.write(POSTAMBLE);
        return buf2;
    }

    /**
File
ConsoleNote.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Return statement
Variable