Write the extension to the OutputStream.

@param out the OutputStream to write the extension to
@exception IOException on encoding errors
523
public void encode(OutputStream out) throws IOException {
        DerOutputStream  tmp = new DerOutputStream();
        if (extensionValue == null) {
            extensionId = PKIXExtensions.CertificateIssuer_Id;
            critical = true;
            encodeThis();
        }
        super.encode(tmp);
        out.write(tmp.toByteArray());
    }
1368019
public void write(Writer out)
         throws IOException
    {
        out.write("<!--\n");
        super.write(out);
        out.write("\n-->");
    }
1362091
@Override
  public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);

    // Encode flag
    out.writeBoolean(isPruned);
    // Encode size
    out.writeVInt(size);
    // Encode type of encoding
    out.writeVInt(termsEncoding.ordinal());
    // Encode terms
    out.writeBytesRef(encodedTerms);
    // Release terms
    encodedTerms = null;
  }
1112616
protected void encode(OutputStream out, ObjectIdentifier extensionId,
        boolean isCritical) throws IOException {

       DerOutputStream  tmp = new DerOutputStream();

       if (this.extensionValue == null) {
           this.extensionId = extensionId;
           this.critical = isCritical;
           encodeThis();
       }
       super.encode(tmp);
       out.write(tmp.toByteArray());
    }
847064
public void write(OutputStream out)throws SocksException,
                                             IOException{
     if(data == null){
       Socks5Message msg;

       if(addrType == SOCKS_ATYP_DOMAINNAME)
          msg = new Socks5Message(command,host,port);
       else{
          if(ip == null){
             try{
               ip = InetAddress.getByName(host);
             }catch(UnknownHostException uh_ex){
               throw new SocksException(Proxy.SOCKS_JUST_ERROR);
             }
          }
          msg = new Socks5Message(command,ip,port);
       }
       data = msg.data;
     }
     out.write(data);
   }
691791
public void write(DataOutput out) throws IOException {
        t.write(out);
        out.writeInt(position);
    }
671956
private void writeObject(ObjectOutputStream out) throws IOException {
        ObjectOutputStream.PutField fields = out.putFields();
        fields.put("language", baseLocale.getLanguage());
        fields.put("script", baseLocale.getScript());
        fields.put("country", baseLocale.getRegion());
        fields.put("variant", baseLocale.getVariant());
        fields.put("extensions", localeExtensions == null ? "" : localeExtensions.getID());
        fields.put("hashcode", -1); // place holder just for backward support
        out.writeFields();
    }
104772
@Override
  public void write(OutputStream out) throws IOException {
    try {
      valueSerializer = null;

      XMLStreamWriter serializer = factory.createXMLStreamWriter(out,
        "UTF-8");
      serializer.setPrefix(RequestConstants.RESTAPI_PREFIX,
        RequestConstants.RESTAPI_NS);
      serializer.setPrefix(RequestConstants.SEARCH_PREFIX,
        RequestConstants.SEARCH_NS);
      serializer.setPrefix("xsi",
        XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
      serializer.setPrefix("xs", XMLConstants.W3C_XML_SCHEMA_NS_URI);

      serializer.writeStartDocument("utf-8", "1.0");

      serializer.writeStartElement(RequestConstants.RESTAPI_PREFIX,
        "rule", RequestConstants.RESTAPI_NS);

      serializer.writeStartElement(RequestConstants.RESTAPI_PREFIX,
        "name", RequestConstants.RESTAPI_NS);
      serializer.writeCharacters(getName());
      serializer.writeEndElement();

      serializer.writeStartElement(RequestConstants.RESTAPI_PREFIX,
        "description", RequestConstants.RESTAPI_NS);
      String description = getDescription();
      if ( description != null ) serializer.writeCharacters(description);
      serializer.writeEndElement();
      serializer.flush();

      // logger.debug("Send: " + new String(queryPayload));
      XMLEventWriter eventWriter = factory.createXMLEventWriter(out);
      for (XMLEvent event : this.queryPayload) {
        eventWriter.add(event);
      }
      eventWriter.flush();
      out.flush();

      writeMetadataElement(serializer);

      serializer.writeEndElement();
      serializer.writeEndDocument();
    } catch (XMLStreamException e) {
      throw new MarkLogicIOException("Failed to serialize rule", e);
    } catch (TransformerFactoryConfigurationError e) {
      throw new MarkLogicIOException("Failed to serialize rule", e);
    } catch (TransformerException e) {
      throw new MarkLogicIOException("Failed to serialize rule", e);
    } finally {
      valueSerializer = null;
    }

  }
323720
public void write(Writer out)
         throws IOException
    {
        out.write('<'+tag+attributes()+'>');
        super.write(out);
        out.write("</"+tag+"\n>");
    }
1193011
public void encode(OutputStream out) throws IOException {
        DerOutputStream tmp = new DerOutputStream();
        tmp.write(key.getEncoded());

        out.write(tmp.toByteArray());
    }
84608
private void encodeThis() throws IOException {
        if (names == null || names.isEmpty()) {
            this.extensionValue = null;
            return;
        }
        DerOutputStream os = new DerOutputStream();
        names.encode(os);
        this.extensionValue = os.toByteArray();
    }
89188
public void write(OutputStream out)
         throws IOException
    {
        Writer writer = new OutputStreamWriter(out);
        write(writer);
        writer.flush();
    }
162209
public static void writeObjectToStream(final Object o, OutputStream out) {
    out = new BufferedOutputStream(out);
    try {
      final ObjectOutputStream oos = new ObjectOutputStream(out);
      oos.writeObject(o);
      oos.flush();
    } catch (final IOException e) {
      e.printStackTrace();
    }
  }
600468
public void write(DataOutput out) throws IOException {
        WritableUtils.writeVInt(out, length);
        out.write(bytes, 0, length);
    }
117390
public void writeExternal(final ObjectOutput out) throws IOException {
        out.writeLong( this.size );
        out.writeInt( this.nodeId );
    }
993297
private void simpleWriteString(String outString, OutputStream outStream) throws IOException
   {
      for (int i = 0; i < outString.length(); i++)
      {
         int charCode = outString.charAt(i);
         outStream.write(charCode & 0xFF);
         outStream.write((charCode >> 8) & 0xFF);
      }
   }
1285267
public void serialize(final OutputStream out) throws IOException {
    final Writer writer = new BufferedWriter(new OutputStreamWriter(out));
    this.seqModel.serialize(out);
    writer.flush();
  }