Writes a JSON array item start.

@throws IOException if an error occurs
427365
void writeArrayItemStart() throws IOException {
        if (commaState.get(commaDepth)) {
            output.append(',');
            if (newLine.length() > 0) {
                output.append(' ');
            }
        } else {
            commaState.set(commaDepth);
        }
    }
1088967
protected JsonWriter property(String key, Object[] array) throws IOException {
      return property(key, Arrays.asList(array));
   }
432796
private void write(Kim kim, Huff huff, Huff ext) throws JSONException {
        for (int at = 0; at < kim.length; at += 1) {
            int c = kim.get(at);
            write(c, huff);
            while ((c & 128) == 128) {
                at += 1;
                c = kim.get(at);
                write(c, ext);
            }
        }
    }
384467
public void write(JsonGenerator jsonGenerator) throws IOException {
    jsonGenerator.writeStartObject();

    // clusterNodeInfo begins
    jsonGenerator.writeFieldName("clusterNodeInfo");
    jsonGenerator.writeStartObject();
    jsonGenerator.writeStringField("name", clusterNodeInfo.name);
    jsonGenerator.writeObjectField("address", clusterNodeInfo.address);
    jsonGenerator.writeObjectField("total", clusterNodeInfo.total);
    jsonGenerator.writeObjectField("free", clusterNodeInfo.free);
    jsonGenerator.writeObjectField("resourceInfos",
      clusterNodeInfo.resourceInfos);
    jsonGenerator.writeEndObject();
    // clusterNodeInfo ends

    // grants begins
    jsonGenerator.writeFieldName("grants");
    jsonGenerator.writeStartObject();
    for (Map.Entry<GrantId, ResourceRequestInfo> entry : grants.entrySet()) {
      jsonGenerator.writeFieldName(entry.getKey().unique);
      jsonGenerator.writeStartObject();
      jsonGenerator.writeFieldName("grantId");
      entry.getKey().write(jsonGenerator);
      jsonGenerator.writeFieldName("grant");
      entry.getValue().write(jsonGenerator);
      jsonGenerator.writeEndObject();
    }
    jsonGenerator.writeEndObject();
    // grants ends

    jsonGenerator.writeEndObject();
    // We skip the hostNode and lastHeartbeatTime as they need not be persisted.
    // resourceTypeToMaxCpu and resourceTypeToStatsMap can be rebuilt using the
    // conf and the grants respectively.
  }
1334737
public void beginArray() throws IOException {
    int p = peeked;
    if (p == PEEKED_NONE) {
      p = doPeek();
    }
    if (p == PEEKED_BEGIN_ARRAY) {
      push(JsonScope.EMPTY_ARRAY);
      pathIndices[stackSize - 1] = 0;
      peeked = PEEKED_NONE;
    } else {
      throw new IllegalStateException("Expected BEGIN_ARRAY but was " + peek()
          + " at line " + getLineNumber() + " column " + getColumnNumber() + " path " + getPath());
    }
  }
1302669
public static void writeJSON(Map<String, ? extends Object> map, Appendable out, JSONStyle compression)
			throws IOException {
		if (map == null) {
			out.append("null");
			return;
		}
		JsonWriter.JSONMapWriter.writeJSONString(map, out, compression);
	}
450792
void writeString(String value) throws IOException {
        output.append('"');
        for (int i = 0; i < value.length(); i++) {
            char ch = value.charAt(i);
            if (ch < 128) {
                String replace = REPLACE[ch];
                if (replace != null) {
                    output.append(replace);
                } else {
                    output.append(ch);
                }
            } else if (ch == '\u2028') {
                output.append("\\u2028");  // match other JSON writers
            } else if (ch == '\u2029') {
                output.append("\\u2029");  // match other JSON writers
            } else {
                output.append(ch);
            }
        }
        output.append('"');
    }
712210
private void writeObject(java.io.ObjectOutputStream s)
        throws java.io.IOException {
        // Write out any hidden serialization magic
        s.defaultWriteObject();

        // Write out size
        s.writeInt(size);

        // Write out all elements in the proper order.
        for (Node<E> x = first; x != null; x = x.next)
            s.writeObject(x.item);
    }
1059132
public synchronized void write( Collection<MLArray> data) throws IOException
    {
        try
        {
           
            //write data
            for ( MLArray matrix : data )
            {
            	write(matrix);
            }
        }
        catch ( IllegalArgumentException iae)
        {
        	isStillValid = false;
        	throw iae;
        }
        catch ( IOException e )
        {
            throw e;
        }
    }
246834
@Override
    public void onWriteError(Exception ex, List<? extends File> items) {
        log.error("Error writing item(s): " + items.toString(), ex);
    }
1083615
protected JsonWriter value(@NonNull Object[] array) throws IOException {
      return value(Arrays.asList(array));
   }
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);
	}
285598
function writeJSON(file, json){
	var s = file.split(".");
	if (s.length > 0) {
		var ext = s[s.length - 1];
		if (ext != "json"){
			file = file + ".json";
		}
	}
  fs.writeFileSync(file, JSON.stringify(json));
}
1306690
@Override
  public void write(JsonWriter writer, SpeechWordConfidence speechWordConfidence) throws IOException {
    writer.beginArray();

    writer.value(speechWordConfidence.getWord());
    writer.value(speechWordConfidence.getConfidence());

    writer.endArray();
    writer.flush();
  }
392924
public JSONWriter arrayBegin() throws IOException {
        beforeValue();

        writer.write(JSON.LSQUARE);
        stack.push(state);
        state = new State(ARRAY);
        return this;
    }
483069
public void write(JsonGenerator jsonGenerator) throws IOException {
    jsonGenerator.writeStartObject();
    jsonGenerator.writeStringField("poolGroupName", poolGroupName);
    jsonGenerator.writeStringField("poolName", poolName);
    jsonGenerator.writeEndObject();
  }
1113227
public void write(final char[] data,
                      final int start,
                      final int count) throws IOException {
        write(new String(data, start, count));
    }