All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spinjar.com.minidev.json.reader.ArrayWriter Maven / Gradle / Ivy

There is a newer version: 7.22.0-alpha5
Show newest version
package net.minidev.json.reader;

import java.io.IOException;

import net.minidev.json.JSONStyle;
import net.minidev.json.JSONValue;

public class ArrayWriter implements JsonWriterI {
	public  void writeJSONString(E value, Appendable out, JSONStyle compression) throws IOException {
		compression.arrayStart(out);
		boolean needSep = false;
		for (Object o : ((Object[]) value)) {
			if (needSep)
				compression.objectNext(out);
			else
				needSep = true;
			JSONValue.writeJSONString(o, out, compression);
		}
		compression.arrayStop(out);
	}
}