class JsonWriter {

    public void writeEndArray() throws JsonException {
        JsonToken token = stack.pop();
        try {
            if (token == array) {
                writer.write(']');
                commaFirst = true;
            } else {
                throw new JsonException("Syntax error. Unexpected element ']'.");
            }
        } catch (IOException e) {
            throw new JsonException(e.getMessage(), e);
        }
    }

    public  JsonWriter(Writer writer);
    public  JsonWriter(OutputStream out);

}