Serialize to the given writer, keeping it open when finished. If
skipNonOverrides is true, any configuration whose values are all null
will not be written.
764806
public void write(boolean skipNonOverrides,
                      boolean withXMLDeclaration,
                      PrintWriter writer) {

        final String indent = "                           ";

        // header
        if (withXMLDeclaration) {
            writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        }
        writer.println("<" + _CONFIG + " xmlns=\"" + BE_SECURITY.uri + "\"");
        writer.println(indent + " xmlns:xsi=\"" + XSI.uri + "\"");
        writer.println(indent + " xsi:schemaLocation=\"" + BE_SECURITY.uri
                + " " + BE_SECURITY1_0.xsdLocation + "\"");

        // default values
        writer.print(indent);
        write(m_defaultConfig, false, skipNonOverrides, writer);
        writer.println(">");

        // fedoraInternalCall-1 and -2
        writeInternalConfig(1,
                            m_internalSSL,
                            m_internalBasicAuth,
                            m_internalUsername,
                            m_internalPassword,
                            m_internalIPList,
                            writer);
        writeInternalConfig(2,
                            Boolean.FALSE,
                            Boolean.FALSE,
                            null,
                            null,
                            m_internalIPList,
                            writer);

        // sDep roles
        Iterator<String> bIter = m_sDepConfigs.keySet().iterator();
        while (bIter.hasNext()) {
            String role = bIter.next();
            ServiceDeploymentRoleConfig bConfig = m_sDepConfigs.get(role);
            write(bConfig, true, skipNonOverrides, writer);
            // per-method roles
            Iterator<String> mIter = bConfig.getMethodConfigs().keySet().iterator();
            while (mIter.hasNext()) {
                String methodName = mIter.next();
                MethodRoleConfig mConfig =
                        bConfig.getMethodConfigs().get(methodName);
                write(mConfig, true, skipNonOverrides, writer);
            }
        }

        // closing element for entire doc
        writer.println("</" + _CONFIG + ">");
    }
375424
def Serialize(self, writer):
        
        writer.WriteUInt32(self.Magic)
        writer.WriteFixedString(self.Command, 12)
        writer.WriteUInt32(len(self.Payload))
        writer.WriteUInt32(self.Checksum)
        writer.WriteBytes(self.Payload)
819034
def SerializeExclusiveDataAlternative(self, writer):
        
        byt = int.to_bytes(self.Nonce, 4, 'little')
        ba = bytearray(byt)
        byts = binascii.hexlify(ba)
        writer.WriteBytes(byts)
79056
public void encodeNullToNull(Writer writer, T obj) throws IOException {
		if (obj == null) {
			writer.write("null");
			return;
		}

		JsonUtil.startHash(writer);

		encodeValue(writer, obj);

		JsonUtil.endHash(writer);

		writer.flush();
	}
1122334
public Writer write(Writer writer) throws JSONException {
        try {
            if (m_map.isEmpty()) {
                writer.write("{}");
                return writer;
            }
            // This prefix value applies to the first key only
            String keyprefix = "{\"";
            for (Entry<String, Object> entry : m_map.entrySet()) {
                writer.write(keyprefix);
                writer.write(quotable(entry.getKey()));
                writer.write("\":");
                Object v = entry.getValue();
                if (v instanceof JSONObject) {
                    ((JSONObject)v).write(writer);
                }
                else if (v instanceof JSONArray) {
                    ((JSONArray)v).write(writer);
                }
                else {
                    writer.write(valueToString(v));
                }
                // This prefix value applies to all subsequent keys
                keyprefix = ",\"";
            }
            writer.write('}');
            return writer;
        }
        catch (IOException exception) {
            throw new JSONException(exception);
        }
     }
567355
public void writeValue(Object value) throws IOException
    {
        if (value == null) {
            writeNullValue();
            return;
        }
        _writeValue(value, _writerLocator.findSerializationType(value.getClass()));
    }
93849
public void write(Writer writer) throws IOException {
    final Properties properties = new Properties();

    for (Map.Entry<DictionaryAttribute, String> e : getAttributes().entrySet()) {
      properties.setProperty(e.getKey().propertyName, e.getValue());
    }

    properties.store(writer, "# " + getClass().getName());
  }
1130780
public void write(ObjectWriter out, PersistedNodeData nodeData) throws IOException
   {
      // write id
      out.writeInt(SerializationConstants.PERSISTED_NODE_DATA);

      // TransientItemData
      out.writeString(nodeData.getQPath().getAsString());
      out.writeString(nodeData.getIdentifier());

      if (nodeData.getParentIdentifier() != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeString(nodeData.getParentIdentifier());
      }
      else
         out.writeByte(SerializationConstants.NULL_DATA);

      out.writeInt(nodeData.getPersistedVersion());
      // -------------------

      out.writeInt(nodeData.getOrderNumber());

      // primary type
      out.writeString(nodeData.getPrimaryTypeName().getAsString());

      // mixins
      InternalQName[] mixinNames = nodeData.getMixinTypeNames();

      if (mixinNames != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         out.writeInt(mixinNames.length);
         for (int i = 0; i < mixinNames.length; i++)
         {
            out.writeString(mixinNames[i].getAsString());
         }
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }

      ACLWriter wr = new ACLWriter();

      AccessControlList acl = nodeData.getACL();
      if (acl != null)
      {
         out.writeByte(SerializationConstants.NOT_NULL_DATA);
         wr.write(out, acl);
      }
      else
      {
         out.writeByte(SerializationConstants.NULL_DATA);
      }
   }
1031880
public void write(ObjectWriter out, ItemState itemState) throws IOException
   {
      // write id
      out.writeInt(SerializationConstants.ITEM_STATE);

      out.writeInt(itemState.getState());
      out.writeBoolean(itemState.isPersisted());
      out.writeBoolean(itemState.isEventFire());

      if (itemState.getOldPath() == null)
      {
         out.writeInt(SerializationConstants.NULL_DATA);
      }
      else
      {
         out.writeInt(SerializationConstants.NOT_NULL_DATA);
         byte[] buf = itemState.getOldPath().getAsString().getBytes(Constants.DEFAULT_ENCODING);
         out.writeInt(buf.length);
         out.write(buf);
      }

      // write flag isNodeData and ItemData
      ItemData data = itemState.getData();

      boolean isNodeData = (data instanceof PersistedNodeData);
      out.writeBoolean(isNodeData);
      if (isNodeData)
      {
         PersistedNodeDataWriter wr = new PersistedNodeDataWriter();
         wr.write(out, (PersistedNodeData)data);
      }
      else
      {
         PersistedPropertyDataWriter wr = new PersistedPropertyDataWriter();
         wr.write(out, (PersistedPropertyData)data);
      }
   }
1000053
public void setWriter (Writer writer) {
		if (!(writer instanceof JsonWriter)) writer = new JsonWriter(writer);
		this.writer = (JsonWriter)writer;
		this.writer.setOutputType(outputType);
		this.writer.setQuoteLongValues(quoteLongValues);
	}
845389
public void write(ObjectWriter out, PersistedValueData vd) throws IOException
   {
      out.writeInt(SerializationConstants.PERSISTED_VALUE_DATA);
      out.writeInt(vd.getOrderNumber());

      boolean isByteArray = vd.isByteArray();
      out.writeBoolean(isByteArray);

      if (isByteArray)
      {
         byte[] data = vd.getAsByteArray();
         out.writeInt(data.length);
         out.write(data);
      }
      else
      {
         // write file content
         FilePersistedValueData streamed = (FilePersistedValueData)vd;

         InputStream in = null;

         if (streamed.getFile() == null && vd instanceof StreamPersistedValueData)
         {
            if (((StreamPersistedValueData)vd).getTempFile() != null)
            {
               in = PrivilegedFileHelper.fileInputStream(((StreamPersistedValueData)vd).getTempFile());
            }
         }
         else
         {
            in = streamed.getAsStream();
         }

         if (streamed.getFile() instanceof SerializationSpoolFile)
         {
            SerializationSpoolFile ssf = (SerializationSpoolFile)streamed.getFile();
            out.writeString(ssf.getId());
            out.writeLong(0);
         }
         else
         {
            // write property id - used for reread data optimization
            String id = IdGenerator.generate();
            out.writeString(id);

            if (in == null)
            {
               // Deleted state usecase
               out.writeLong(SerializationConstants.NULL_FILE);
            }
            else
            {
               out.writeLong(vd.getLength());
               try
               {
                  byte[] buf = new byte[SerializationConstants.INTERNAL_BUFFER_SIZE];
                  int l = 0;
                  while ((l = in.read(buf)) >= 0)
                  {
                     out.write(buf, 0, l);
                  }
               }
               finally
               {
                  in.close();
               }
            }
         }
      }
   }
377038
def Serialize(self, writer):
        
        writer.WriteVarString(self.name)
        writer.WriteVarString(self.symbol)
        writer.WriteUInt8(self.decimals)
84749
public Writer write(Writer writer) throws JSONException {
        try {
            boolean notFirst = false;
            writer.write('{');
            for(Iterator it = myHashMap.entrySet().iterator(); it.hasNext();) {
                Map.Entry entry = (Entry)it.next();
                if (notFirst) {
                    writer.write(',');
                }
                writeQuoted(writer, entry.getKey());
                writer.write(':');
                writeValue(writer, entry.getValue());
                notFirst = true;
            }
            writer.write('}');
            return writer;
        } catch (IOException e) {
            throw new JSONException(e);
        }
    }
435551
def Serialize(self, writer):
        
        super(UnspentCoinState, self).Serialize(writer)

        writer.WriteVarInt(len(self.Items))

        for item in self.Items:
            byt = item.to_bytes(1, 'little')
            writer.WriteByte(byt)
169704
public void save(Writer writer) throws IOException {
        BufferedWriter bufferWriter = new BufferedWriter(writer);
        writePrefixDeclaration(bufferWriter);
        writeMappingDeclaration(bufferWriter);
        bufferWriter.flush();
        bufferWriter.close();
    }
3303
public void serialize( JsonWriter writer, T bean, JsonSerializationContext ctx ) {
        Map map = getValue( bean, ctx );
        if ( null != map ) {
            ((MapJsonSerializer) getSerializer()).serializeValues( writer, map, ctx, getParameters() );
        }
    }
200913
public void writeTo(Writer writer) {
        try {
            try (InputStream in = body();
                 Reader reader = new InputStreamReader(in, getCharset())) {
                Readers.transferTo(reader, writer);
            }
        } catch (IOException e) {
            throw new RequestsException(e);
        } finally {
            close();
        }
    }