/** * Encodes an ASN.1 header for an object with the ID and * length specified. * @param os * an <code>OutputStream</code> to which the header is encoded. * @param type * the type of the ASN.1 object. Must be < 30, i.e. no extension octets. * @param length * the length of the object. The maximum length is 0xFFFFFFFF; * @throws IOException */ public static final void encodeHeader(OutputStream os, int type, int length) throws IOException { os.write(type); encodeLength(os, length); }
/** * Encodes an ASN.1 header for an object with the ID and * length specified. * @param os * an {@code OutputStream} to which the header is encoded. * @param type * the type of the ASN.1 object. Must be < 30, i.e. no extension octets. * @param length * the length of the object. The maximum length is 0xFFFFFFFF; * @throws IOException * if the output stream fails to store the encoded header. */ public static void encodeHeader(OutputStream os, int type, int length) throws IOException { os.write(type); encodeLength(os, length); }
/** * Encodes an ASN.1 header for an object with the ID and * length specified. * @param os * an {@code OutputStream} to which the header is encoded. * @param type * the type of the ASN.1 object. Must be < 30, i.e. no extension octets. * @param length * the length of the object. The maximum length is 0xFFFFFFFF; * @throws IOException * if the output stream fails to store the encoded header. */ public static void encodeHeader(OutputStream os, int type, int length) throws IOException { os.write(type); encodeLength(os, length); }
/** * Encode an ASN.1 header for a sequence with the ID and length specified. * This only works on data types < 30, i.e. no extension octets. * The maximum length is 0xFFFF; * * @param os * an <code>OutputStream</code> to which the length is encoded. * @param type * the tag type for the integer (typically 0x02) * @param length * the length of the sequence to encode. * @throws IOException */ public static final void encodeSequence(OutputStream os, byte type, int length) throws IOException { os.write(type); encodeLength(os, length); }
/** * Encodes an ASN.1 header for an object with the ID and * length specified with a fixed length of the encoded length as supplied. * @param os * an <code>OutputStream</code> to which the header is encoded. * @param type * the type of the ASN.1 object. Must be < 30, i.e. no extension octets. * @param length * the length of the object. The maximum length is 0xFFFFFFFF; * @param numBytesLength * the number of bytes used to encode the length of the length. * @throws IOException */ public static final void encodeHeader(OutputStream os, int type, int length, int numBytesLength) throws IOException { os.write(type); encodeLength(os, length, numBytesLength); }
/** * Encode an ASN.1 header for a sequence with the ID and length specified. * This only works on data types < 30, i.e. no extension octets. * The maximum length is 0xFFFF; * * @param os * an {@code OutputStream} to which the length is encoded. * @param type * the tag type for the integer (typically 0x02) * @param length * the length of the sequence to encode. * @throws IOException * if the output stream fails to store the encoded value. */ public static void encodeSequence(OutputStream os, byte type, int length) throws IOException { os.write(type); encodeLength(os, length); }
/** * Encode an ASN.1 header for a sequence with the ID and length specified. * This only works on data types < 30, i.e. no extension octets. * The maximum length is 0xFFFF; * * @param os * an {@code OutputStream} to which the length is encoded. * @param type * the tag type for the integer (typically 0x02) * @param length * the length of the sequence to encode. * @throws IOException * if the output stream fails to store the encoded value. */ public static void encodeSequence(OutputStream os, byte type, int length) throws IOException { os.write(type); encodeLength(os, length); }
/** * Encodes an ASN.1 header for an object with the ID and * length specified with a fixed length of the encoded length as supplied. * @param os * an {@code OutputStream} to which the header is encoded. * @param type * the type of the ASN.1 object. Must be < 30, i.e. no extension octets. * @param length * the length of the object. The maximum length is 0xFFFFFFFF; * @param numBytesLength * the number of bytes used to encode the length of the length. * @throws IOException * if the output stream fails to store the encoded header. */ public static void encodeHeader(OutputStream os, int type, int length, int numBytesLength) throws IOException { os.write(type); encodeLength(os, length, numBytesLength); }
/** * Encodes an ASN.1 header for an object with the ID and * length specified with a fixed length of the encoded length as supplied. * @param os * an {@code OutputStream} to which the header is encoded. * @param type * the type of the ASN.1 object. Must be < 30, i.e. no extension octets. * @param length * the length of the object. The maximum length is 0xFFFFFFFF; * @param numBytesLength * the number of bytes used to encode the length of the length. * @throws IOException * if the output stream fails to store the encoded header. */ public static void encodeHeader(OutputStream os, int type, int length, int numBytesLength) throws IOException { os.write(type); encodeLength(os, length, numBytesLength); }