01: package org.bouncycastle.asn1;
02:
03: import java.io.ByteArrayOutputStream;
04: import java.io.IOException;
05: import java.io.OutputStream;
06:
07: public class DERSequenceGenerator extends DERGenerator {
08: private final ByteArrayOutputStream _bOut = new ByteArrayOutputStream();
09:
10: public DERSequenceGenerator(OutputStream out) throws IOException {
11: super (out);
12: }
13:
14: public DERSequenceGenerator(OutputStream out, int tagNo,
15: boolean isExplicit) throws IOException {
16: super (out, tagNo, isExplicit);
17: }
18:
19: public void addObject(DEREncodable object) throws IOException {
20: object.getDERObject().encode(new DEROutputStream(_bOut));
21: }
22:
23: public OutputStream getRawOutputStream() {
24: return _bOut;
25: }
26:
27: public void close() throws IOException {
28: writeDEREncoded(DERTags.CONSTRUCTED | DERTags.SEQUENCE, _bOut
29: .toByteArray());
30: }
31: }
|