Package java.io

Examples of java.io.ObjectInput.readObject()


      if (cache == null) {
        return null;
      }
      ByteArrayInputStream stream = new ByteArrayInputStream(cache.getCacheValue());
      ObjectInput in = new ObjectInputStream(stream);
      Object object = in.readObject();
      return object;
     
  }
 
  public static String getCacheText(String siteId, String cacheKey) throws Exception {
View Full Code Here


                            if ( oi==null ) {
                                break;
                            }
                            try {
                                is.mark(100);
                                vSerialNrsTmp.add((BigInteger)oi.readObject());
                            } catch( StreamCorruptedException e ) {
                                oi=null;
                            }
                        }
                    } catch( EOFException e) {/* do nothing*/}
 
View Full Code Here

        }
        if(data != null) {
            ObjectInput ois = null;
            try {
                ois = new ObjectInputStream(new ByteArrayInputStream(data));
                JMeterTreeNode[] nodes = (JMeterTreeNode[]) ois.readObject();
                return nodes;
            } catch (ClassNotFoundException cnfe) {
                throw new IOException("Failed to read object stream.", cnfe);
            } finally {
                if(ois != null) {
View Full Code Here

        ObjectInput input = new ObjectInputStream(buffer);

        AccessToken token = null;

        try {
            token = (AccessToken) input.readObject();
        } catch (ClassNotFoundException e) {
            log.error("Erro reading token from disk: ", e);
        } finally {
            input.close();
        }
View Full Code Here

        out.flush();
        outbuf.close();

        ByteArrayInputStream  inbuf = new ByteArrayInputStream(outbuf.toByteArray());
        ObjectInput  in = new ObjectInputStream(inbuf);
        return in.readObject();
    }

// ----------------------------------------------------------------------------- Package scope ������
// ----------------------------------------------------------------------------- Protected ������
// ----------------------------------------------------------------------------- Private ������
View Full Code Here

        out.flush();
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws IOException, ClassNotFoundException {
        ObjectInput in = IOConverter.toObjectInput(stream);
        return in.readObject();
    }
}
View Full Code Here

  }
 
  protected static Object deserialize(byte[] bytes) throws Exception {
    ByteArrayInputStream bin = new ByteArrayInputStream(bytes);
    ObjectInput in = new ObjectInputStream(bin);
    return in.readObject();
  }
}
View Full Code Here

       
        //deserialize object
        try {
      InputStream is = new ByteArrayInputStream(response.getBodyBytes());
      ObjectInput oi = new ObjectInputStream(is);
      testobj = (JafSerializableObj) oi.readObject();
      oi.close();
    } catch (ClassNotFoundException e) {
      System.out.println("TestJAFProvider: " + e.toString());
      assertTrue(false);
    } catch (StreamCorruptedException e) {
View Full Code Here

  public Object getContent(DataSource ds) throws IOException {
    InputStream is = ds.getInputStream();   
    ObjectInput oi = new ObjectInputStream(is);   
    Object obj = null;   
    try{
      obj = oi.readObject();
      oi.close();
    } catch (ClassNotFoundException e) {
      System.out.println("Class not found");
    }
    return obj;
View Full Code Here

      ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
      ObjectInput in = null;
      try {
        in = new ObjectInputStream(bis);
        Object o = in.readObject();
       
        return o;
       
      } finally {
        bis.close();
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.