Package java.io

Examples of java.io.ObjectInput


        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutput out = new ObjectOutputStream(buffer);
        out.writeObject(test);
        out.close();

        ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(
            buffer.toByteArray()));
        in.readObject();
        in.close();

        harness.check(false, "serialize error");
      }
    catch (Exception e)
      {       
View Full Code Here


        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        ObjectOutput out = new ObjectOutputStream(buffer);
        out.writeObject(inObj);
        out.close();

        ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(
            buffer.toByteArray()));
        outObj = (CorrectEnumSyntax) in.readObject();
        in.close();

        harness.check(true, "serialize no error");
       
        // test for identical object
        harness.check(inObj == outObj, "identity test");
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(ta1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      ta2 = (TextAttribute) in.readObject();
      in.close();
    }
    catch (Exception e) {
      harness.debug(e);
    }
    harness.check(ta1 == ta2)// the readResolve() method ensures that only
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(tm1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      tm2 = (TreeMap) in.readObject();
      in.close();
    }
    catch (Exception e) {
        harness.debug(e);
    }
    harness.check(tm1.equals(tm2));
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(p1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      p2 = (TreePath) in.readObject();
      in.close();
    }
    catch (Exception e) {
      harness.debug(e);
    }
    harness.check(p1.equals(p2));
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(d1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      d2 = (Date) in.readObject();
      in.close();
    }
    catch (Exception e) {
      harness.debug(e);
    }
    harness.check(d1.equals(d2));
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(c1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      c2 = (ColorUIResource) in.readObject();
      in.close();
    }
    catch (Exception e) {
      harness.debug(e);
    }
    harness.check(c1.equals(c2));
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(list1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      list2 = (List) in.readObject();
      in.close();
    }
    catch (Exception e) {
        harness.debug(e);
    }
    harness.check(list1.equals(list2));
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(t1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      t2 = (TestObjectInputValidation) in.readObject();
      in.close();

      harness.check(t2, t1); // name and priority the same
      harness.check(t2.object, t2); // has self-reference
      harness.check(t2.validated != null);
View Full Code Here

      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      ObjectOutput out = new ObjectOutputStream(buffer);
      out.writeObject(x1);
      out.close();

      ObjectInput in = new ObjectInputStream(
        new ByteArrayInputStream(buffer.toByteArray())
      );
      x2 = (MySerializable) in.readObject();
      in.close();
    }
    catch (Exception e)
    {
      harness.debug(e);
    }
View Full Code Here

TOP

Related Classes of java.io.ObjectInput

Copyright © 2018 www.massapicom. 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.