Package java.io

Examples of java.io.ObjectOutputStream.writeInt()


            if(value != null){
                notNullValues.add(value);
            }
        }
               
        stream.writeInt(notNullValues.size());
        for (String key : keys) {
            Object object = variables.get(key);
            if(object != null){
                stream.writeUTF(key);
                int index = context.objectMarshallingStrategyStore.getStrategy(object);
View Full Code Here


        for (String key : keys) {
            Object object = variables.get(key);
            if(object != null){
                stream.writeUTF(key);
                int index = context.objectMarshallingStrategyStore.getStrategy(object);
                stream.writeInt(index);
                ObjectMarshallingStrategy strategy = context.objectMarshallingStrategyStore.getStrategy(index);
                if(strategy.accept(object)){
                    strategy.write(stream, object);
                }
            }
View Full Code Here

        final FastMultiByteArrayOutputStream bos = new FastMultiByteArrayOutputStream();
        final OutputStream os = compress ? new LZFOutputStream(bos) : bos;
        final ObjectOutputStream oos;
        try {
            oos = new ObjectOutputStream(os);
            oos.writeInt(actsize);
            for(int i = 0; i < actsize; i++) {
                oos.writeObject(result[i]);
                result[i] = null;
            }
            oos.flush();
View Full Code Here

                }
            }
           
            ObjectOutputStream oos = new ObjectOutputStream(bos);
           
            oos.writeInt(nKeys);
           
            for (String key : ctx.keySet()) {
                Object value = ctx.get(key);
                if (isPersistable(key, value)) {
                    oos.writeObject(key);
View Full Code Here

           
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            ObjectOutputStream objOut = new ObjectOutputStream( bout );
           
            objOut.writeObject( an._data );
            objOut.writeInt( an._dataClassParam );
            objOut.flush();
            bout.close();
           
            byte[] bytes = bout.toByteArray();
            out.writeInt( bytes.length );
View Full Code Here

            out.write(NODELIST_DOWNLOAD_TYPE);
            out.flush();

            // Write out the control port
            ObjectOutputStream outControl = new ObjectOutputStream(out);
            outControl.writeInt(this.controlPort);
            outControl.flush();

            // For each node, add an entry to cluster nodes
            ObjectInputStream inData = new ObjectInputStream(in);
            int nodeCount = inData.readInt();
View Full Code Here

                    Integer.parseInt(port));
            OutputStream out = heartbeatSocket.getOutputStream();
            out.write(NODE_HEARTBEAT_TYPE);
            out.flush();
            ObjectOutputStream outData = new ObjectOutputStream(out);
            outData.writeInt(this.controlPort);
            outData.close();
            heartbeatSocket.close();
            Logger.log(Logger.FULL_DEBUG, CLUSTER_RESOURCES,
                    "SimpleCluster.HeartbeatSent", address);
        } catch (ConnectException err) {/* ignore - 3 fails, and we remove */
 
View Full Code Here

            if (!node.equals(ipPortSender))
                relevantClusterNodes.add(node);
        }

        ObjectOutputStream outData = new ObjectOutputStream(out);
        outData.writeInt(relevantClusterNodes.size());
        outData.flush();
        for (Iterator i = relevantClusterNodes.iterator(); i.hasNext();) {
            String ipPort = (String) i.next();
            if (!ipPort.equals(ipPortSender))
                outData.writeUTF(ipPort);
View Full Code Here

        ObjectOutputStream ooStream = new ObjectOutputStream(oStream);
        ObjectInputStream iiStream = null;
        for (int i = 0; i < 1000000; ++i) {
          this.payload = new String("10|Gipsy|European|Rome|300.00").getBytes();

          ooStream.writeInt(this.payload.length);
          transferred += 4;
          ooStream.write(this.payload); // send serialized payload
          transferred += this.payload.length;

          ooStream.flush();
View Full Code Here

          if (iiStream == null)
            iiStream = new ObjectInputStream(iStream);

          iiStream.readByte();
        }
        ooStream.writeInt(0);

        System.out.println("Transferred total MB: " + (float) transferred / 1000000 + " in " + (System.currentTimeMillis() - date)
            + "ms");

        Thread.sleep(1000);
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.