// Allocate a LdapMessageContainer Container
IAsn1Container ldapMessageContainer = new LdapMessageContainer();
// Decode the PDU
ldapDecoder.decode( buffer, ldapMessageContainer );
// Check that everything is OK
LdapMessage ldapmessage = ( (LdapMessageContainer) ldapMessageContainer ).getLdapMessage();
LdapMessageWithPDU message = new LdapMessageWithPDU();