Examples of readObject()


Examples of java.io.ObjectInput.readObject()

        try {
            ObjectInput oi = new ObjectInputStream(is);
            int nKeys = oi.readInt();
           
            for (int i = 0; i < nKeys; i++) {
                String key = (String)oi.readObject();
                Object value = oi.readObject();
                ctx.put(key, value);
            }
           
            // construct SOAPMessage from input stream
View Full Code Here

Examples of java.io.ObjectInputStream.readObject()

      logger.log(BasicLevel.DEBUG, "loadobj, after load call");

    ByteArrayInputStream bis = new ByteArrayInputStream(content);
    ObjectInputStream ois = new ObjectInputStream(bis);
    try {
      Object obj = ois.readObject();
      return obj;
    } catch (Exception e) {
      String exceptionString = e.toString();
      if (exceptionString.indexOf("KNOWN PROBLEM") == -1)
      {
View Full Code Here

Examples of java.io.ObjectOutput.readObject()

            try {
                // Read the system in
                f = new FileInputStream(filename);
                s = new ObjectInputStream(f);

                ExampleSystem newExampleSystem = (ExampleSystem) s.readObject();
                String newDescription = newExampleSystem.toString();
                String oldDescription = exampleSystem.toString();

                if (oldDescription.equals(newDescription)) {
                    System.out.println("OK: Description read in from "
View Full Code Here

Examples of java.io.ObjectOutputStream.readObject()

          commandOptions.printUsage(true);
          throw new IllegalArgumentException("Missing model file option");
        }
        ObjectInputStream s =
          new ObjectInputStream(new FileInputStream(modelOption.value));
        crf = (CRF) s.readObject();
        s.close();
      }
      if (eval != null)
        test(new NoopTransducerTrainer(crf), eval, testData);
      else
View Full Code Here

Examples of javassist.util.proxy.ProxyObjectInputStream.readObject()

    {
        try
        {
            ByteArrayInputStream bais = new ByteArrayInputStream(buf);
            ObjectInputStream ois = new ProxyObjectInputStream(bais);
            Object obj = ois.readObject();
            ois.close();
            return obj;
        }
        catch (Exception e)
        {
View Full Code Here

Examples of javax.jms.BytesMessage.readObject()

        
         for (;;)
         {
            try
            {
               list.add(convert(msg.readObject()));
            }
            catch (MessageEOFException e)
            {
               break;
            }
View Full Code Here

Examples of javax.jms.MapMessage.readObject()

            StreamMessage src = (StreamMessage) message;
            Object lastRead = null;
            do {
                lastRead = null;
                try {
                    lastRead = src.readObject ();
                    if ( lastRead != null ) {
                        m.writeObject ( lastRead );
                        // System.out.println ( "Copied object: " + lastRead );
                        // System.out.println ( "to message: " + m );
                    }
View Full Code Here

Examples of javax.jms.StreamMessage.readObject()

         recv.readLong() == 3141592653589793238L);
      assertTrue("Double == 3.1415926535897932384626433832795",
         recv.readDouble() == 3.1415926535897932384626433832795);
      assertTrue("Float == true", recv.readFloat() == 3.141f);
      assertTrue("Object == 31415926535897932384626433832795",
         recv.readObject().equals("31415926535897932384626433832795"));
      assertTrue("String == 31415926535897932384626433832795",
         recv.readString().equals("31415926535897932384626433832795"));
   }

   protected void setUp() throws Exception
View Full Code Here

Examples of javax.json.JsonReader.readObject()

    public void testSimpleObjectWithTwoElements() throws JSONException {
        JsonReader jsonReader = Json.createReader(new StringReader("{"
                + "  \"apple\":\"red\","
                + "  \"banana\":\"yellow\""
                + "}"));
        JsonObject json = jsonReader.readObject();
       
        assertNotNull(json);
        assertFalse(json.isEmpty());
        assertTrue(json.containsKey("apple"));
        assertEquals("red", json.getString("apple"));
View Full Code Here

Examples of javax.sql.rowset.serial.SQLInputImpl.readObject()

        Struct struct2 = new MockStruct(structAttributes, "not stored name");
        HashMap<String, Class<?>> types = new HashMap<String, Class<?>>();
        types.put("harmonytests.MockSQLData", MockSQLData.class);
        Object[] attributes = new Object[] { struct, struct2, null, "xyz" };
        SQLInputImpl impl = new SQLInputImpl(attributes, types);
        Object obj = impl.readObject();
        assertTrue(obj instanceof MockSQLData);
        MockSQLData sqlData = (MockSQLData) obj;
        assertEquals(structAttributes[0], sqlData.firstAttribute);
        assertEquals(structAttributes[1], sqlData.secondAttribute);
        assertEquals(structAttributes[2], sqlData.thirdAttribute);
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.