Package org.jboss.serial.io

Examples of org.jboss.serial.io.JBossObjectOutputStream


   {
      TestMessage tm = new TestMessage(456, false);
     
      ByteArrayOutputStream os = new ByteArrayOutputStream();
     
      JBossObjectOutputStream oos = new JBossObjectOutputStream(os);
     
      oos.writeObject(tm);
     
      oos.close();
     
      byte[] bytes = os.toByteArray();
     
      ByteArrayInputStream is = new ByteArrayInputStream(bytes);
     
View Full Code Here


         out.writeByte(SERIALIZABLE);
         ObjectOutputStream oos;
        
         if (useJBossSerialization)
         {
            oos = new JBossObjectOutputStream(out);
         }
         else
         {
            oos = new ObjectOutputStream(out);
         }
View Full Code Here

    return builder.buildFeatureType();
  }

  private VectorLayerRasterizingInfo cloneInfo(VectorLayerRasterizingInfo input) throws GeomajasException {
    try {
      JBossObjectOutputStream jbossSerializer = new JBossObjectOutputStream(null);
      Object obj = jbossSerializer.smartClone(input);
      return (VectorLayerRasterizingInfo) obj;
    } catch (IOException e) {
      // should not happen
      throw new GeomajasException(e, ExceptionCode.UNEXPECTED_PROBLEM);
    }
View Full Code Here

    try {
      this.authorizations = new byte[authorizations.length][];
      for (int i = 0; i < authorizations.length; i++) {
        ba = authorizations[i];
        ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
        JBossObjectOutputStream serialize = new JBossObjectOutputStream(baos);
        serialize.writeObject(ba);
        serialize.flush();
        serialize.close();
        this.authorizations[i] = baos.toByteArray();
      }
    } catch (IOException ioe) {
      Logger log = LoggerFactory.getLogger(SavedAuthenticationImpl.class);
      log.error("Could not serialize " + ba + ", may cause rights to be lost.", ioe);
View Full Code Here

      return value.toString();
    } else {
      try {
        log.debug("Serializing {} for unique id", value.getClass().getName());
        ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
        JBossObjectOutputStream serialize = new JBossObjectOutputStream(baos);
        serialize.writeObject(value);
        serialize.flush();
        serialize.close();
        return baos.toString("UTF-8");
      } catch (IOException ioe) {
        String fallback = value.toString();
        log.error("Could not serialize " + value + ", falling back to toString() which may cause problems.",
            ioe);
View Full Code Here

      {
         ObjectOutputStream out;

         ByteArrayOutputStream baos = new ByteArrayOutputStream();

         out = new JBossObjectOutputStream(baos, false);
         out.writeObject(this);
         out.flush();

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
View Full Code Here

      {
         ObjectOutputStream out;

         ByteArrayOutputStream baos = new ByteArrayOutputStream();

         out = new JBossObjectOutputStream(baos, false);
         out.writeObject(this);
         out.flush();

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
View Full Code Here

      {
         ObjectOutputStream out;

         ByteArrayOutputStream baos = new ByteArrayOutputStream();

         out = new JBossObjectOutputStream(baos, false);
         out.writeObject(this);
         out.flush();

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
View Full Code Here

      {
         FileOutputStream fos = FOSAction.open(file);
         // todo need to rewrite SessionObjectOutputStream to support EJB3 classes
         ObjectOutputStream out;

         out = new JBossObjectOutputStream(fos, false);

         try
         {
            out.writeObject(ctx);
            out.flush();
View Full Code Here

{

    public void testNonSerializableOptionTrue() throws Exception
    {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        JBossObjectOutputStream out = new JBossObjectOutputStream(byteOut);
        Object obj = NonSerializableTestData.createObj();
        out.writeObject(obj);
        out.flush();

        ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOut.toByteArray());
        JBossObjectInputStream inp = new JBossObjectInputStream(byteInput);

        Object obj2 = inp.readObject();
View Full Code Here

TOP

Related Classes of org.jboss.serial.io.JBossObjectOutputStream

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.