Why Deserialize / Serialize does not give the same result ?

David Fischer <[email protected]> Fri, 28 Jul 2006 23:44:23 +0200
Newsgroups gmane.comp.java.openamf.user
Organization Ingenieurbuero David Fischer GmbH
Message-ID <[email protected]>
Hi

I have recorded a message with a sniffer and stored it into a file.
Thereafter I have made a small program which reads the file and it
seems that it works - all data are here, but later when I save the AMF
message back to a file, the output file contains only a part of the
data, it is smaller and I miss some data at the end of the output file.
Does anybody know what I am doing wrong ?
David

import java.io.*;
import org.openamf.io.AMFDeserializer;
import org.openamf.io.AMFSerializer;
import org.openamf.AMFMessage;

import org.apache.commons.logging.*;
import org.apache.commons.logging.impl.*;


public class Test
{
    public static void main(String[] args)
    {
        try
        {
            Log log = LogFactory.getLog(AMFDeserializer.class);
            ((SimpleLog)log).setLevel(SimpleLog.LOG_LEVEL_DEBUG );

            AMFDeserializer amfDeserializer = new AMFDeserializer(new
DataInputStream(new FileInputStream("response.amf")));
            AMFMessage amfMessage = amfDeserializer.getAMFMessage();
            System.out.println(amfMessage);

            DataOutputStream dout = new DataOutputStream(new
FileOutputStream("out.amf"));
            AMFSerializer amfSerializer = new AMFSerializer(dout);
            amfSerializer.serializeMessage(amfMessage);
            dout.close();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Openamf-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openamf-user
fischer.vcf (text/x-vcard, 273 B)
begin:vcard
fn:David Fischer
n:Fischer;David
org:Ingenieurbuero David Fischer GmbH
adr:;;Lindenstrasse 21;Allschwil;;4123;Switzerland
email;internet:[email protected]
tel;work:+41 (0)79 752'52'09
x-mozilla-html:FALSE
url:http://www.d-fischer.com
version:2.1
end:vcard