Examples of ObjectInputStream


Examples of java.io.ObjectInputStream

      Byte[] s = new Byte[]{1, 2, 3, 4};
      m.objectToObjectStream(s, out);
      out.close();

      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      ObjectInputStream ois = new ObjectInputStream(bin);

      Object o = m.objectFromObjectStream(ois);

      ois.close();

      assert o instanceof Byte[];
      Byte[] oS = (Byte[]) o;
      assert oS.length == 4;
      assert oS[0] == 1;
View Full Code Here

Examples of java.io.ObjectInputStream

      Object[] s = {"Hello", Fqn.fromString("/a"), 1, null};
      m.objectToObjectStream(s, out);
      out.close();

      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      ObjectInputStream ois = new ObjectInputStream(bin);

      Object o = m.objectFromObjectStream(ois);

      ois.close();

      assert o instanceof Object[];
      Object[] oS = (Object[]) o;
      assert oS.length == 4;
      assert oS[0].equals("Hello");
View Full Code Here

Examples of java.io.ObjectInputStream

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      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

Examples of org.apache.geronimo.interop.rmi.iiop.ObjectInputStream

        int keyType = keyLength == 0 ? 0 : objectKey[0];

        ReplyHeader_1_2 reply = new ReplyHeader_1_2();
        reply.request_id = request.request_id;

        ObjectInputStream objectIn;
        ObjectOutputStream objectOut;

        if (simpleIDL || keyType == 'N' || keyType == 'J') {
            // Name Service and JMS use simple IDL interoperability.
            objectIn = org.apache.geronimo.interop.rmi.iiop.SimpleObjectInputStream.getInstance(parameters);
View Full Code Here

Examples of org.jboss.ejb3.proxy.impl.io.ObjectInputStream

      out.writeObject(obj);
      out.flush();
      out.close();
     
      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      ObjectInputStream in = new ObjectInputStream(bin, target);
      Object result = in.readObject();
      in.close();
      return result;
   }
View Full Code Here

Examples of rocket.serialization.client.ObjectInputStream

  public String invoke(final String input, final Object serviceProvider) {
    Checker.notNull("parameter:serviceProvider", serviceProvider);

    ServerSerializationFactory serializationFactory = createSerializationFactory();

    final ObjectInputStream inputStream = serializationFactory.createObjectInputStream(input);
    final ObjectOutputStream outputStream = serializationFactory.createObjectOutputStream();

    Object result = null;
    boolean exceptionWasThrown = false;
    Method method = null;

    // read in the interface...
    final String interfaceName = (String) inputStream.readObject();
    final Class interfacee = this.getRequestedInterface(interfaceName);

    // verify the serviceProvider actually implements $interface
    this.checkServiceProvider(interfacee, serviceProvider);

    // the method name...
    final String methodName = (String) inputStream.readObject();

    // the parameter types...
    final int parameterCount = inputStream.readInt();
    final String[] parameterTypes = new String[parameterCount];
    for (int i = 0; i < parameterTypes.length; i++) {
      parameterTypes[i] = (String) inputStream.readObject();
    }

    // attempt to find a method on the given interface that matches the
    // method signature...
    method = this.getMethod(serviceProvider.getClass(), methodName, parameterTypes);

    // deserialize parameters...
    final Object[] parameters = new Object[parameterCount];
    for (int i = 0; i < parameterCount; i++) {
      parameters[i] = inputStream.readObject();
    }

    // any exceptions that are thrown will be serialized and included in the
    // response...
    try {
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.