[EMAIL PROTECTED] a écrit :

> I want to use asn1 codec in mina. 


Could you give us more info about your need? As I already stated, there
is no generic ASN.1 codec, there is only a Ldap ASN.1 codec, which is
very different. Consider this as different as a C compiler and a
compiled program.

> mina said it "could" adapt apache shared-asn1, 

It "could" and it "does" adapt apache shared-asn1 LDAP specific codec.
It does it by implementing two interfaces :
org.apache.directory.shared.asn1.codec.stateful.StatefulDecoder
and
org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder

If you look ate the two classes in mina-filter-asn1-codec, you will have
all you need to understand how it works, from a mina point of view :
org.apache.mina.filter.codec.asn1.Asn1CodecDecoder
and
org.apache.mina.filter.codec.asn1.Asn1CodecEncoder


> but I can't find the way. 

This is the way, but this has been done for LDAP ASN.1 codec

> Anybody help me? I'm exhausted. I don't know how to implement
> shared-asn1 interface: StatefulEncoder and StatefulDecoder.

just look here :
org.apache.directory.shared.ldap.message.MessageEncoder
and
org.apache.directory.shared.ldap.message.MessageDecoder

Those class are in shared-ldap, and they implements StatefulEncoder and
StatefulDecoder

>>
>> > I don't know about any open source ASN.1 codec available out there.
>>
>> There's one: http://lionet.info/asn1c
>
Sorry, What I meant was Java OSS ASN.1 codec. Btw, very cool
implementation. I tested it three month ago, and it works like a champ !

Any plan to migrate it to Java ?

Emmanuel Lécharny

Reply via email to