Sending serialized bytesteam over the internet is generally bad idea - it's really difficult to ensure serialised bytes compatibility on both ends (JVM version, serial vgersion UID and couple of other factors really matter.)
If I were you, I would use JSON / XML data binding for this purpose On 10 Mai, 02:33, dillipk <codersnet2...@gmail.com> wrote: > Hello, > I am trying to deserialize some byte[] data which the app receives > from server in android, but the data after deserialization isn't > correct. > > Below code works absolutely fine with BlackBerry, but I wonder why > it doesn't in android..!!!? AM I MISSING SOMETHING??? Any help on this > is highly appreciated.. > ------------------------------------------------------------------------------------------------------------------------------------------------ > String fiename; > String email; > byte[] byteImageData = null; > > public void deserialize(byte[] array) throws IOException { > System.out.println("begin DeSerializing UserAdInfo :"); > ByteArrayInputStream in = new ByteArrayInputStream(array); > DataInputStream dIn = new DataInputStream(in); > > filename = dIn.readUTF(); > email = dIn.readUTF(); > > byteImageData = new byte[dIn.available()]; > dIn.read(byteImageData); > > } > > ------------------------------------------------------------------------------------------------------------------------------------------------ > > If there is some sample source to support deserialzation in android > would be a great help.. > > Thanks in advance.. > > Regards, > -DK > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en