Package java.io

Examples of java.io.ObjectInputStream.readObject()


    }else{
     
      try{
        ObjectInputStream  iis = new ObjectInputStream( new ByteArrayInputStream( data ));
       
        Object  res = iis.readObject();
       
        if ( target.isInstance( res )){
         
          return( res );
         
View Full Code Here


          tempV = (Vector) xml.read(sFile);
        }
        else {*/
        InputStream is = new FileInputStream(sFile);
        ObjectInputStream ois = new ObjectInputStream(is);
        tempV = (Vector)ois.readObject();
        ois.close();
        //}
      } catch (Exception ex) {
        System.err.println("[KnowledgeFlow] Problem reading user components.");
        ex.printStackTrace();
View Full Code Here

      ObjectOutputStream oos = new ObjectOutputStream(baos);
      oos.writeObject(lock);
      oos.close();
      baos.close();
      ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
      OwnableReentrantLock l2 = (OwnableReentrantLock) ois.readObject();

      assert !l2.isLocked();
      assert l2.getOwner() == null;
   }
}
View Full Code Here

      oos.writeObject(object);
      oos.close();
      baos.close();

      ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
      Object retval = ois.readObject();
      ois.close();
      return (T) retval;
   }
}
View Full Code Here

   
    try {
      try {
        bais = new ByteArrayInputStream(body);
        ois = new ObjectInputStream(bais);
        obj = ois.readObject();
      } catch (ClassNotFoundException cnfexc) {
        // Could not build serialized object: reason could be linked to
        // class loaders hierarchy in an application server.
        class Specialized_OIS extends ObjectInputStream {
          Specialized_OIS(InputStream is) throws IOException {
View Full Code Here

          }
        }

        bais = new ByteArrayInputStream(body);
        ois = new Specialized_OIS(bais);
        obj = ois.readObject();
      }
    } catch (Exception exc) {
      if (logger.isLoggable(BasicLevel.ERROR))
        logger.log(BasicLevel.ERROR, "ERROR: getObject()", exc);
      // Don't forget to rethrow the Exception
View Full Code Here

            new ByteArrayInputStream(Utils.decode64(s
                .substring(cp + 1))));
        Throwable restoreError;
        try {
          Object so;
          result.put(aname, so = ois.readObject());
          restoreError = null;
          if (so instanceof HttpSessionActivationListener)
            ((HttpSessionActivationListener) so)
                .sessionDidActivate(new HttpSessionEvent(result));
View Full Code Here

    byte[] message = new byte[bodySize];
    msgReceived.getBodyBuffer().readBytes(message);
    ByteArrayInputStream bais = new ByteArrayInputStream(message);
    try {
      ObjectInputStream ois = new ObjectInputStream(bais);
      return ois.readObject();
    } catch (IOException e) {
      throw new IOException("Error reading message");
    } catch (ClassNotFoundException e) {
      throw new IOException("Error creating message");
    }
View Full Code Here

    public void execute(Content content) {
      ByteArrayInputStream bis = new ByteArrayInputStream(content.getContent());
      ObjectInputStream in;
      try {
        in = new ObjectInputStream(bis);
        Object result = in.readObject();
        in.close();
        results.put("Result", result);
        if (result instanceof Map) {
          Map<?, ?> map = (Map) result;
          for (Map.Entry<?, ?> entry: map.entrySet()) {
View Full Code Here

    int bodySize = serverMessage.getBodySize();
    byte[] message = new byte[bodySize];
    serverMessage.getBodyBuffer().readBytes(message);
    ByteArrayInputStream bais = new ByteArrayInputStream(message);
    ObjectInputStream ois = new ObjectInputStream(bais);
    return ois.readObject();
  }
 
  private void createClientQueue() {
    try {
      session.createQueue(name, name, true);
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.