Appends the certificate to an output stream.

@param out an output stream to which the certificate is appended.
@exception CertificateException on encoding errors.
@exception IOException on other errors.
501596
public void encode(OutputStream out)
    throws CertificateException, IOException {
        if (rawCertInfo == null) {
            DerOutputStream tmp = new DerOutputStream();
            emit(tmp);
            rawCertInfo = tmp.toByteArray();
        }
        out.write(rawCertInfo.clone());
    }
192122
public void encode(OutputStream out) throws IOException {
        DerOutputStream tmp = new DerOutputStream();
        if (extensionValue == null) {
            extensionId = PKIXExtensions.SubjectKey_Id;
            critical = false;
            encodeThis();
        }
        super.encode(tmp);
        out.write(tmp.toByteArray());
    }
580746
protected Object writeReplace() throws java.io.ObjectStreamException {
        try {
            return new CertificateRep(type, getEncoded());
        } catch (CertificateException e) {
            throw new java.io.NotSerializableException
                                ("java.security.cert.Certificate: " +
                                type +
                                ": " +
                                e.getMessage());
        }
    }
443499
public void writeTo(final OutputStream out) throws IOException
	{
		if(out == null) throw new NullPointerException();
		
		final int n = arrays.size();
		for(int k = 0; k < n; k++) {
			byte[] src = (byte[])arrays.get(k);
			out.write(src);
		}
		if(pos > 0) out.write(buffer, 0, pos);
	}
1172201
public static synchronized X509CertificatePair generateCertificatePair
            (byte[] encoded) throws CertificateException {
        Object key = new Cache.EqualByteArray(encoded);
        X509CertificatePair pair = cache.get(key);
        if (pair != null) {
            return pair;
        }
        pair = new X509CertificatePair(encoded);
        key = new Cache.EqualByteArray(pair.encoded);
        cache.put(key, pair);
        return pair;
    }
1040136
protected Object writeReplace() throws ObjectStreamException {
        try {
            return new CertPathRep(type, getEncoded());
        } catch (CertificateException ce) {
            NotSerializableException nse =
                new NotSerializableException
                    ("java.security.cert.CertPath: " + type);
            nse.initCause(ce);
            throw nse;
        }
    }
57473
public static void copy(byte[] in, OutputStream out) throws IOException {
		Assert.notNull(in, "No input byte array specified");
		Assert.notNull(out, "No OutputStream specified");
		out.write(in);
	}
221493
private static void _appendHexEntity (final StringBuilder out, final char value)
  {
    out.append ("&#x").append (Integer.toHexString (value)).append (';');
  }
92114
public static void writeMapEntry(OutputAccessor out, String key, Object value) {

        out.write((byte) '\"');

        if (key == null)
            out.write(NULL);
        else {
            writeUtf8(out, key);
        }

        out.write(Q_AND_C);

        toJSONString(out, value);
    }
875331
public void encode(OutputStream out) throws IOException {

        // in cases where default constructor is used check for
        // null values
        if (notBefore == null || notAfter == null) {
            throw new IOException("CertAttrSet:CertificateValidity:" +
                                  " null values to encode.\n");
        }
        DerOutputStream pair = new DerOutputStream();

        if (notBefore.getTime() < YR_2050) {
            pair.putUTCTime(notBefore);
        } else
            pair.putGeneralizedTime(notBefore);

        if (notAfter.getTime() < YR_2050) {
            pair.putUTCTime(notAfter);
        } else {
            pair.putGeneralizedTime(notAfter);
        }
        DerOutputStream seq = new DerOutputStream();
        seq.write(DerValue.tag_Sequence, pair);

        out.write(seq.toByteArray());
    }
89188
public void write(OutputStream out)
         throws IOException
    {
        Writer writer = new OutputStreamWriter(out);
        write(writer);
        writer.flush();
    }
223290
public static void encodeSingle(final int input, final byte[] output,
                                    final int outoff) {

        if (output == null) {
            throw new NullPointerException("output");
        }

        if (outoff < 0) {
            throw new IllegalArgumentException("outoff(" + outoff + ") < 0");
        }

        if (outoff >= output.length - 1) {
            throw new IllegalArgumentException(
                "outoff(" + outoff + ") >= output.length(" + output.length
                + ") - 1");
        }

        output[outoff] = (byte) encodeHalf((input >> 4) & 0x0F);
        output[outoff + 1] = (byte) encodeHalf(input & 0x0F);
    }
858301
public static Writer getOutputStreamWriter(OutputStream out) {
    try {
      return new OutputStreamWriter(out, "UTF-8");
    }
    catch (UnsupportedEncodingException ex) {
      throw new RuntimeException(ex); // shouldn't happen since UTF-8 is supported by all JVMs per spec
    }
  }
1212507
public void encode(OutputStream out) throws IOException {
       DerOutputStream  tmp = new DerOutputStream();
        encode(out, PKIXExtensions.CRLNumber_Id, true);
    }
11400
public void encode(DerOutputStream out) throws IOException {
        if (isEmpty()) {
            return;
        }

        DerOutputStream temp = new DerOutputStream();
        for (GeneralName gn : names) {
            gn.encode(temp);
        }
        out.write(DerValue.tag_Sequence, temp);
    }
108184
public void storeFlattened(OutputStream out) throws IOException {
        Properties p = new Properties();
        for (String key : keySet()) {
            if (!p.containsKey(key)) {
                p.setProperty(key, get(key));
            }
        }

        p.store(out, null);
    }
171778
public void encode(InputStream inStream, OutputStream outStream)
        throws IOException {
        int     j;
        int     numBytes;
        byte    tmpbuffer[] = new byte[bytesPerLine()];

        encodeBufferPrefix(outStream);

        while (true) {
            numBytes = readFully(inStream, tmpbuffer);
            if (numBytes == 0) {
                break;
            }
            encodeLinePrefix(outStream, numBytes);
            for (j = 0; j < numBytes; j += bytesPerAtom()) {

                if ((j + bytesPerAtom()) <= numBytes) {
                    encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
                } else {
                    encodeAtom(outStream, tmpbuffer, j, (numBytes)- j);
                }
            }
            if (numBytes < bytesPerLine()) {
                break;
            } else {
                encodeLineSuffix(outStream);
            }
        }
        encodeBufferSuffix(outStream);
    }