Reuse of Java Encoding Objects

The concept of reusing Java objects for PER encoding is the same as was described previously for BER encoding. Basically, all that needs to be done is the creation of a single PER encode buffer object and an object corresponding to the ASN.1 data type to be encoded outside of the processing loop. These objects can then be reused to encode each instance of the messages to be sent. After each message is encoded, the PER buffer must be reset for the next message by using the reset method. See the section on reuse of objects in the BER encoding section for a more thorough discussion and sample code on using this capability.