2 Replies Latest reply on Jul 11, 2007 11:58 AM by Newsgroup_User

    ByteArray serialization

    bldrbldr Level 1
      Using RemoteObject calls, I'm able to return a java byte[] from a server method and it comes out just fine on the client as a flash.utils.ByteArray object. But when I have a byte[] as a member of an enclosing class, I'm getting null on the client for the ByteArray. Example:

      Java class
      package org.xyz;

      public class DimensionTest {
      private byte[] _component = new byte[] {1,2,3,4,5,6};
      }

      AS class
      package org.xyz
      {
      import flash.utils.ByteArray;

      [RemoteClass(alias="org.xyz.DimensionTest")]
      public class DimensionTest
      {
      public var _component:ByteArray;
      }
      }

      When my server method returns a new DimensionTest, I get an AS DimensionTest class on the client with a null _component.

      Any idea what I'm doing wrong?

      Brian
        • 1. Re: ByteArray serialization
          bldrbldr Level 1
          from page 1371 in the developer's guide.

          values found in public getter/setter method pairs and public variables are passed to the client as properties on an Object. Private properties, constants, static properties, and read-only properties, and so on, are not serialized.
          • 2. Re: ByteArray serialization
            Level 7
            Does this explain your problem?

            > from page 1371 in the developer's guide.
            >
            > values found in public getter/setter method pairs and public
            > variables are passed to the client as properties on an Object. Private
            > properties, constants, static properties, and read-only properties,
            > and so on, are not serialized.