So I am planning to store the data that I inputted to a JSON file and I want that JSON file to be stored to my phone's local storage. But I have this error in my code. It's about the JsonWriter. Can anyone help me? 

```
// THIS IS MY CODE

private void writeToFile(OutputStream out, List<Wordbank> wordList) throws IOException{
    JsonWriter writer = new JsonWriter(new OutputStreamWriter(out, "UTF-8"));
    writer.setIndent(" ");
    writeWordbankArray(writer, wordList);
    writer.close();
}

public void writeWordbankArray(JsonWriter writer, List<Wordbank> wordList) throws  IOException{
    writer.beginArray();
    for(Wordbank wl : wordList){
        writeWordbank(writer, wl);
    }
    writer.endArray();
}

public void writeWordbank(JsonWriter writer, Wordbank wordbank) throws IOException{
    writer.beginObject();
    writer.name("English").value(wordbank.getEnglish());
    writer.name("Cebuano").value(wordbank.getCebuano());
    writer.name("Pronounciation").value(wordbank.getPronounciation());
    writer.name("POS").value(wordbank.getPos());
    writer.name("Audio").value(wordbank.getAudio());
    if(wordbank.getImage() != null || wordbank.getFx() != null){
        writer.name("Picture").value(wordbank.getImage());
        writer.name("Effect").value(wordbank.getFx());
    }else{
        writer.name("No name").nullValue();
    }
    writer.endObject();
}

```

// BELOW IS THE ERROR

```
2018-10-18 18:48:52.372 4965-4965/com.example.sampleFile/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.sampleFile, PID: 4965
java.lang.NullPointerException
    at java.io.Writer.<init>(Writer.java:88)
    at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:97)
    at com.example.sampleFile.backend.AddData.writeToFile(AddData.java:518)
    at com.example.sampleFile.backend.AddData.access$500(AddData.java:61)
    at com.example.sampleFile.backend.AddData$15.onSuccess(AddData.java:460)
    at com.example.sampleFile.backend.AddData$15.onSuccess(AddData.java:453)
    at com.google.firebase.storage.StorageTask.zza(com.google.firebase:firebase-storage@@16.0.2:123)
    at com.google.firebase.storage.zze.zza(Unknown Source:6)
    at com.google.firebase.storage.zzv.zza(com.google.firebase:firebase-storage@@16.0.2:89)
    at com.google.firebase.storage.zzy.run(Unknown Source:6)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6944)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

```

Above is the error. I need help with this, please HELP ME!