Package org.quickconnectfamily.json

Examples of org.quickconnectfamily.json.JSONInputStream.readObject()


      JSONInputStream jsonIn = new JSONInputStream(new FileInputStream(multiObjectFile));

      /*
       * Read the first object from the file
       */
      Object aPossibleMap = jsonIn.readObject();
      assertEquals(HashMap.class, aPossibleMap.getClass());
      HashMap aMap = (HashMap)aPossibleMap;
      assertEquals("Bob", aMap.get("name"));
      assertEquals((long)27, aMap.get("age"));
     
View Full Code Here


      assertEquals((long)27, aMap.get("age"));
     
      /*
       * Test if a second entry be read correctly?
       */
      Object aPossibleArrayList = jsonIn.readObject();
      assertEquals(ArrayList.class, aPossibleArrayList.getClass());
      ArrayList anArrayList = (ArrayList)aPossibleArrayList;
     
     
    } catch (Exception e) {
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.