1 package net.minidev.json.reader;
2
3 import java.io.IOException;
4
5 import net.minidev.json.JSONStyle;
6 import net.minidev.json.JSONValue;
7
8 public class ArrayWriter implements JsonWriterI<Object> {
9     public <E> void writeJSONString(E value, Appendable out, JSONStyle compression) throws IOException {
10         compression.arrayStart(out);
11         boolean needSep = false;
12         for (Object o : ((Object[]) value)) {
13             if (needSep)
14                 compression.objectNext(out);
15             else
16                 needSep = true;
17             JSONValue.writeJSONString(o, out, compression);
18         }
19         compression.arrayStop(out);
20     }
21 }
22