[SNMP4J] PDU serialization

Matthieu Casanova chocolat.mou at gmail.com
Wed Sep 7 17:08:47 CEST 2005


Hi, thanks that's what I expected, but I still have a problem :
To encode the PDU I use a OutputStream, but to decode I need a 
BERInputStream.
Is there any way to decode directly from an InputStream ?
Because maybe I have not understand something with BERInputStream but what I 
do is
to encode the PDU into a String (using ByteArrayOutputStream) and write the 
length of the file followed by the String.
And when reading the file I first read the String, create a BERInputStream 
for each String I have and decode PDU from that, but I think it's not very 
good and there is probably a better solution ...

Matthieu

2005/9/7, fock at agentpp.com <fock at agentpp.com>:
> 
> Hi Matthieu,
> 
> This will be of course compatible with future releases,
> because it encodes the PDU into BER. But also using
> the Java serialization, there should be no problems
> with future releases.
> 
> Best regards,
> Frank
> 
> >
> >Hi, I'm using snmp4j to receive traps.
> >So when I receive one, I would like to serialize the PDU into a file so I
> >can replay the file after.
> >I saw the method PDU.encodeBER(OutputStream outputStream), I suppose this
> >would work, but
> >I would like to be sure that it will be compatible with snmp4j evolution.
> >Any idea bout that ?
> >thanks
> >
> >Matthieu
> >_______________________________________________
> >SNMP4J mailing list
> >SNMP4J at agentpp.org
> ><a target="_blank"
> >href="http://lists.agentpp.org/mailman/listinfo/snmp4j">
> http://lists.agentpp.or
> >g/mailman/listinfo/snmp4j</a>
>



More information about the SNMP4J mailing list