Generate the PDU which contains the encoded object. The generation is done in two phases : - first, we compute the length of each part and the global PDU length - second, we produce the PDU.
0x30 L1 | +--> 0x02 L2 MessageId +--> ProtocolOp +--> Controls L2 = Length(MessageId) L1 = Length(0x02) + Length(L2) + L2 + Length(ProtocolOp) + Length(Controls) LdapMessageLength = Length(0x30) + Length(L1) + L1
@param message The message to encode
@return A ByteBuffer that contains the PDU
@throws EncoderException If anything goes wrong.