Package java.io

Examples of java.io.ObjectInputStream.readObject()


    ByteArrayInputStream bis = new ByteArrayInputStream(reply.agents);
    ObjectInputStream ois = new ObjectInputStream(bis);
    try {
      AgentId id = null;
      Agent agent = null;
      AgentIdStamp.stamp = (AgentIdStamp) ois.readObject();
      while (true) {
        id = (AgentId) ois.readObject();
        agent = (Agent) ois.readObject();
        agent.id = id;
        agent.deployed = true;
View Full Code Here


    try {
      AgentId id = null;
      Agent agent = null;
      AgentIdStamp.stamp = (AgentIdStamp) ois.readObject();
      while (true) {
        id = (AgentId) ois.readObject();
        agent = (Agent) ois.readObject();
        agent.id = id;
        agent.deployed = true;
        // If there is a bag associated with this agent don't initialize it!
        if (agent instanceof BagSerializer) {
View Full Code Here

      AgentId id = null;
      Agent agent = null;
      AgentIdStamp.stamp = (AgentIdStamp) ois.readObject();
      while (true) {
        id = (AgentId) ois.readObject();
        agent = (Agent) ois.readObject();
        agent.id = id;
        agent.deployed = true;
        // If there is a bag associated with this agent don't initialize it!
        if (agent instanceof BagSerializer) {
          ((BagSerializer) agent).readBag(ois);
View Full Code Here

    }
    // inserts all pending messages
    bis = new ByteArrayInputStream(reply.messages);
    ois = new ObjectInputStream(bis);
    try {
      qinFromExt = (Vector) ois.readObject();
      if (logmon.isLoggable(BasicLevel.DEBUG)) {
        for (int i=0; i<qinFromExt.size(); i++) {
          Message msg = (Message) qinFromExt.elementAt(i);
          logmon.log(BasicLevel.DEBUG,
                     AgentServer.getName() + " setState() -> " + msg);
View Full Code Here

  Object load(byte[] buf) throws Exception {
    Object obj = null;
    ByteArrayInputStream bis = new ByteArrayInputStream(buf);
    ObjectInputStream ois = new ObjectInputStream(bis);   
    obj = ois.readObject();
    try {
      ois.close();
    } catch (IOException exc) {}
    return obj;
  }
View Full Code Here

                boolean hasmore = ois.readBoolean();
                if(!hasmore) {
                    break;
                }
                ++count;
                Object ro = ois.readObject();
                Item fetched = (Item) ro;
                _fetchedQueue.offer(fetched);
                if(count == _fetchSize) {
                    break;
                }
View Full Code Here

        } catch (IOException ioe) {
            throw new XQRTException("failed to deserialize the fetched items", ioe);
        }
        try {
            for(int i = 0; i < fetchedLength; i++) {
                Object ro = ois.readObject();
                Item fetched = (Item) ro;
                _fetchedQueue.offer(fetched);
            }
        } catch (IOException ioe) {
            throw new XQRTException("failed to deserialize the fetched items", ioe);
View Full Code Here

*/
public class GradleWorkerMain {
    public void run() throws Exception {
        // Read the main action from stdin and execute it
        ObjectInputStream instr = new ObjectInputStream(System.in);
        Callable<?> main = (Callable<?>) instr.readObject();
        main.call();
    }

    public static void main(String[] args) {
        try {
View Full Code Here

        final ObjectOutputStream out = new ObjectOutputStream(bo);
        out.writeObject(report);

        final ObjectInputStream oin = new ObjectInputStream
          (new ByteArrayInputStream(bo.toByteArray()));
        final MasterReport e2 = (MasterReport) oin.readObject();
        assertNotNull(e2); // cannot assert equals, as this is not implemented.

      }
      catch (Exception e)
      {
View Full Code Here

        try
        {
          final ByteArrayInputStream bin = new ByteArrayInputStream(bo.toByteArray());
          final ObjectInputStream oin = new ObjectInputStream(bin);
          final MasterReport report2 = (MasterReport) oin.readObject();
          report2.setDataFactory(model);

          assertTrue(FunctionalityTestLib.execGraphics2D(report2));
        }
        catch (Exception e)
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.