Package org.fressian

Examples of org.fressian.FressianWriter.writeObject()


     * @throws IOException if connection breaks or server error occurs when processing submitted data;
     */
    public void submit(Object data) throws IOException {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        FressianWriter writer = new FressianWriter(os, FressianTraceFormat.WRITE_LOOKUP);
        writer.writeObject(data);
        writer.close();
        send(ZICO_DATA, ZicoCommonUtil.pack(data));
        ZicoPacket pkt = recv();
        if (pkt.getStatus() != ZICO_OK) {
            throw new ZicoException(pkt.getStatus(), "ZICO submission error: status=" + pkt.getStatus());
View Full Code Here


    public static byte[] pack(Object... data) {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        try {
            FressianWriter writer = new FressianWriter(os, FressianTraceFormat.WRITE_LOOKUP);
            for (Object d : data) {
                writer.writeObject(d);
            }
        } catch (IOException e) {
            log.error(ZorkaLogger.ZAG_ERRORS, "Should not happen.", e);
        }
        return os.toByteArray();
View Full Code Here

        FressianWriter writer = new FressianWriter(os, FressianTraceFormat.WRITE_LOOKUP);

        Object obj;

        while (null != (obj = reader.readObject())) {
            writer.writeObject(obj);

            if (obj instanceof TraceRecord) {
                records++;
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.