Writes the given dictionary to the provided writer.
@param dictionary dictionary to write, cannot be null
@param writer writer, cannot be null
@throws IOException if the dictionary could not be written
777492
public static void writeDictionary(NaaccrDictionary dictionary, Writer writer) throws IOException {
        try {
            instanciateXStream().marshal(dictionary, new NaaccrPrettyPrintWriter(dictionary, writer));
        }
        catch (XStreamException ex) {
            throw new IOException("Unable to write dictionary", ex);
        }
    }
1200039
public void toJson(Writer writer) throws IOException {
		startHash(writer);

		int size = size();
		Set<String> set = keySet();
		int i = 0;
		for (String key : set) {

			putKey(writer, key);
			JsonUtil.put(writer, get(key));

			if (i + 1 < size) {
				addSeparator(writer);
			}
			i++;
		}

		endHash(writer);
	}
857545
def Serialize(self, writer):
        
        super(Block, self).Serialize(writer)
        writer.WriteSerializableArray(self.Transactions)
1254791
public void toJson(Writer writer) throws IOException {
		startArray(writer);

		int size = size();
		for (int i = 0; i < size; i++) {
			put(writer, get(i));
			if (i + 1 < size) {
				addSeparator(writer);
			}
		}

		endArray(writer);
	}
685052
public static void writeLine(BufferedWriter writer, String line) throws IOException {
        writer.write(line);
        writer.newLine();
    }
522490
protected void write(Writer writer, String s) {
    try {
      writer.write(s);
    } catch (IOException e) {
      throw new DukeException(e);
    }
  }
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);
      }
   }
1349841
public void writeExternal(PofWriter writer) throws IOException {
        writer.writeObject(0, expression);
        writer.writeMap(1, variables, String.class);
    }
79616
public void write(String s) throws IOException {
	    if (writer != null) {
	        writer.write(s);
	    } else {
	        write(s, 0, s.length());
	    }
    }
721600
protected void write(Writer writer, WritingVisitor visitor) throws IOException {
      if( isNullObject() ){
         writer.write(JSONNull.getInstance().toString());
      }

      boolean b = false;
      Iterator keys = visitor.keySet(this).iterator();
      writer.write('{');

      while( keys.hasNext() ){
         if( b ){
            writer.write(',');
         }
         Object k = keys.next();
         writer.write(JSONUtils.quote(k.toString()));
         writer.write(':');
         Object v = this.properties.get(k);
         if( v instanceof JSON ){
            visitor.on((JSON) v, writer);
         }else{
            visitor.on(v, writer);
         }
         b = true;
      }
      writer.write('}');
   }
277336
public void write(byte[] b, int off, int len)
        throws IOException
    {
        if (_encoding==null)
            _writer.write(new String(b,off,len));
        else
            _writer.write(new String(b,off,len,_encoding));
    }
1021604
public void write(WARCWritable record) throws IOException {
        if (record.getRecord() != null) write(record.getRecord());
    }
317090
public static void encode (Writer writer, String string) throws IOException
    {
        encode(writer, string, false, true);
    }
1200173
public Writer write(Writer writer) throws JSONException {
		try {
			boolean b = false;
			Iterator keys = keys();
			writer.write('{');

			while (keys.hasNext()) {
				if (b) {
					writer.write(',');
				}
				Object k = keys.next();
				writer.write(quote(k.toString()));
				writer.write(':');
				Object v = this.map.get(k);
				if (v instanceof JSONObject) {
					((JSONObject) v).write(writer);
				} else if (v instanceof JSONArray) {
					((JSONArray) v).write(writer);
				} else {
					writer.write(valueToString(v));
				}
				b = true;
			}
			writer.write('}');
			return writer;
		} catch (IOException e) {
			throw new JSONException(e);
		}
	}
1328538
public void generateOutput(Writer outputWriter) throws IOException {
        String s = generateOutput();
        outputWriter.write(s);
    }
626294
public void write(Writer out)
         throws IOException
    {
        for (int i=0; i <elements.size() ; i++)
        {
            Object element = elements.get(i);
          
            if (element instanceof Element)
                ((Element)element).write(out);
            else if (element==null)
                out.write("null");
            else 
                out.write(element.toString());
        }
    }
786751
private void writeIndention(Writer writer, int indentDepth)
    throws IOException
    {
        if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeIndention(Writer, int)");

        try
        {
            for (int i = 0; i < indentDepth; i++) 
            {
                writer.write(indent);
            }
        }
        catch (Exception ex)
        {
            IOException iox = new IOException("Error occurred on serialization of JSON text.");
            iox.initCause(ex);
            throw iox;
        }

        if (logger.isLoggable(Level.FINER)) logger.exiting(className, "writeIndention(Writer, int)");
    }