#vulnerable code 
                              public void write(Object from, OutputStream target) throws IOException {
    OutputStreamWriter writer = new OutputStreamWriter(target);
    write(from, writer);
    writer.flush();
  } 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              public void write(Object from, OutputStream target) throws IOException {
    OutputStreamWriter writer = new OutputStreamWriter(target, "UTF-8");
    write(from, writer);
    writer.flush();
  }