Package java.io

Examples of java.io.ObjectInputStream.readObject()


    }

    public static <T> T readObject(final InputStream is, final ClassLoader cl) throws IOException,
            ClassNotFoundException {
        final ObjectInputStream ois = new CustomObjectInputStream(is, cl);
        return (T) ois.readObject();
    }

    public static String readString(final ObjectInput in) throws IOException {
        final int len = in.readInt();
        final char[] chrs = new char[len];
View Full Code Here


        out.writeObject(bv);
        out.close();
       
        // now read back the object from serilized state
        ObjectInputStream in = new ObjectInputStream(new FileInputStream(saved));
        BlobType read = (BlobType)in.readObject();
               
        // make sure we have kept the reference stream id
        assertEquals(key, read.getReferenceStreamId());
       
        // and lost the original object
View Full Code Here

        out.writeObject(xv);
        out.close();
       
        // now read back the object from serilized state
        ObjectInputStream in = new ObjectInputStream(new FileInputStream(saved));
        XMLType read = (XMLType)in.readObject();
               
        // make sure we have kept the reference stream id
        assertEquals(key, read.getReferenceStreamId());
       
        // and lost the original object
View Full Code Here

    // only for top level we would have the contents as not null.
    if (contents != null) {
      ByteArrayInputStream bais = new ByteArrayInputStream(contents);
      try {
        ObjectInputStream ois = new ObjectInputStreamWithClassloader(bais, ExceptionHolder.class.getClassLoader());
        return (Throwable)ois.readObject();
      } catch (Exception e) {
        //
      }
    }
    return null;
View Full Code Here

    assertFalse(t.isVirtual());
  }
 
  @Test public void test71Schema() throws Exception {
    ObjectInputStream ois = new ObjectInputStream(new FileInputStream(UnitTestUtil.getTestDataFile("schema.ser")));
    Schema schema = (Schema) ois.readObject();
    assertNotNull(schema.getFunctions());
  }
 
}
View Full Code Here

         servletConnection.setDoOutput(true);
         servletConnection.setUseCaches (false);
         servletConnection.setRequestProperty
             ("Content-Type", "application/octet-stream");
         inFromServlet = new ObjectInputStream(servletConnection.getInputStream());
         al = (Vector) inFromServlet.readObject();
      }
      catch (ClassNotFoundException e) {

         e.printStackTrace();
      }
View Full Code Here

                   
                    ois = new ObjectInputStream( socket.getInputStream());
                   
                    ois.readInt()// version
                   
                    String  header = (String)ois.readObject();
                   
                    if ( !header.equals( getHeader())){
                     
                      log.messageLogged(
                          LoggerChannel.LT_ERROR,
View Full Code Here

                          "SingleInstanceHandler: invalid header - " + header );
                     
                      continue;
                    }

                    String[]  args = (String[])ois.readObject();
                   
                    handler.processArguments( args );
                   
                  }catch( Throwable e ){
                   
View Full Code Here

        connections  = (Vector) v.get(XMLBeans.INDEX_BEANCONNECTIONS);
        //connections  = new Vector();
      } /* binary */ else {
        InputStream is = new FileInputStream(oFile);
        ObjectInputStream ois = new ObjectInputStream(is);
        beans = (Vector) ois.readObject();
        connections = (Vector) ois.readObject();
        ois.close();
      }               

      integrateFlow(beans, connections, true, false);
View Full Code Here

        //connections  = new Vector();
      } /* binary */ else {
        InputStream is = new FileInputStream(oFile);
        ObjectInputStream ois = new ObjectInputStream(is);
        beans = (Vector) ois.readObject();
        connections = (Vector) ois.readObject();
        ois.close();
      }               

      integrateFlow(beans, connections, true, false);
      setEnvironment();
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.