code: public static int encodeSequence(int contentLength, ByteBuffer buf) {
          int headerLength = DerUtils.encodeIdAndLength(DerId.TagClass.UNIVERSAL, DerId.EncodingType.CONSTRUCTED,
                  ASN1_SEQUENCE_TAG_NUM, contentLength, buf);
          return headerLength + contentLength;
      }
docs: Encode an ASN.1 SEQUENCE.
  
  @param contentLength
  the length of the SEQUENCE
  @param buf
  the buffer with space to the left of current position where the value will be encoded
  @return the length of the encoded data