Package org.gradle.messaging.serialize

Examples of org.gradle.messaging.serialize.FlushableEncoder


        target.print(daemonGreeting());

        // Encode as ascii
        try {
            OutputStream outputStream = new EncodedStream.EncodedOutput(target);
            FlushableEncoder encoder = new OutputStreamBackedEncoder(outputStream);
            encoder.writeNullableString(pid == null ? null : pid.toString());
            encoder.writeString(uid);
            MultiChoiceAddress multiChoiceAddress = (MultiChoiceAddress) address;
            UUID canonicalAddress = (UUID) multiChoiceAddress.getCanonicalAddress();
            encoder.writeLong(canonicalAddress.getMostSignificantBits());
            encoder.writeLong(canonicalAddress.getLeastSignificantBits());
            encoder.writeInt(multiChoiceAddress.getPort());
            encoder.writeSmallInt(multiChoiceAddress.getCandidates().size());
            for (InetAddress inetAddress : multiChoiceAddress.getCandidates()) {
                encoder.writeBinary(inetAddress.getAddress());
            }
            encoder.writeString(daemonLog.getPath());
            encoder.flush();
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }

        target.println();
View Full Code Here


    public void write(Collection<TestClassResult> results) {
        try {
            OutputStream outputStream = new FileOutputStream(resultsFile);
            try {
                if (!results.isEmpty()) { // only write if we have results, otherwise truncate
                    FlushableEncoder encoder = new KryoBackedEncoder(outputStream);
                    encoder.writeSmallInt(RESULT_VERSION);
                    write(results, encoder);
                    encoder.flush();
                }
            } finally {
                outputStream.close();
            }
        } catch (IOException e) {
View Full Code Here

        Decoder decoder = new KryoBackedDecoder(inputStream);
        return new MessageReader(decoder, payloadSerializer.newReader(decoder));
    }

    public ObjectWriter<InterHubMessage> newWriter(OutputStream outputStream) {
        FlushableEncoder encoder = new KryoBackedEncoder(outputStream);
        return new MessageWriter(encoder, payloadSerializer.newWriter(encoder));
    }
View Full Code Here

TOP

Related Classes of org.gradle.messaging.serialize.FlushableEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.