JsonWriter writer = new JsonWriter(new FileWriter(dataFile, false));
writer.setIndent(" ");
writer.beginArray();
for (List<Channel> chanList : instance.channels.values()) {
for (Channel chan : chanList) {
writer.beginObject();
writer.name("name").value(chan.getName());
if(chan.getUser() != null) {
writer.name("user").value(chan.getUser());
}
writer.name("type").value(chan.getType().ordinal());