Package java.io

Examples of java.io.ObjectInput.readObject()


            //deserialize
            ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
            try {
                in = new ObjectInputStream(bis);
                ds = (DataSource) in.readObject();
            } finally {
                try {
                    bis.close();
                } catch (IOException ex) {
                    // ignore close exception
View Full Code Here


    Object object;
    try {
      ByteArrayInputStream bis = new ByteArrayInputStream(byteArray);
      ObjectInput oi = new ObjectInputStream(bis);  
      try {
        object = oi.readObject();
      }
      finally {
        oi.close();
        bis.close();
      }
View Full Code Here

    if(in instanceof ObjectInput) {
      return ((ObjectInput)in).readObject();
    } else {
      if(in instanceof InputStream) {
        ObjectInput objIn = new ObjectInputStream((InputStream)in);
        Object obj = objIn.readObject();
        return obj;
      }
    }
    throw new IOException("cannot write to DataOutput of instance:"
        + in.getClass());
View Full Code Here

    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws IOException, ClassNotFoundException {
        ObjectInput in = ExchangeHelper.convertToType(exchange, ObjectInput.class, stream);
        try {
            return in.readObject();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                // ignore
View Full Code Here

        // use buffering
        InputStream fis = new FileInputStream(pendingUploads);
        InputStream buffer = new BufferedInputStream(fis);
        ObjectInput input = new ObjectInputStream(buffer);
        try {
            asyncUploadMap = (Map<String, Long>) input.readObject();
            // display its data
        } finally {
            input.close();
        }
    }
View Full Code Here

        // use buffering
        InputStream fis = new FileInputStream(toBeDeletedUploads);
        InputStream buffer = new BufferedInputStream(fis);
        ObjectInput input = new ObjectInputStream(buffer);
        try {
            toBeDeleted = (Set<String>) input.readObject();
        } finally {
            input.close();
        }
    }
}
View Full Code Here

    ByteArrayInputStream bais = new ByteArrayInputStream( externalizedContext );
    ObjectInput oi = null;
    CorrelationContext context = null;
    try {
      oi = new ObjectInputStream( bais );
      context = (CorrelationContext) oi.readObject();
    } catch ( IOException e ) {
      throw new IllegalArgumentException( e );
    } catch ( ClassNotFoundException e ) {
      throw new IllegalArgumentException( e );
    } finally {
View Full Code Here

            out.writeObject(o1);
            out.close();

            ObjectInput in = new ObjectInputStream(
                    new ByteArrayInputStream(buffer.toByteArray()));
            o2 = (CrosshairOverlay) in.readObject();
            in.close();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

            out.writeObject(d1);
            out.close();

            ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(
                    buffer.toByteArray()));
            d2 = (DefaultBoxAndWhiskerCategoryDataset) in.readObject();
            in.close();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

            out.writeObject(a1);
            out.close();

            ObjectInput in = new ObjectInputStream(
                    new ByteArrayInputStream(buffer.toByteArray()));
            a2 = (NumberAxis3D) in.readObject();
            in.close();
        }
        catch (Exception e) {
            System.out.println(e.toString());
        }
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.