class IOSStringsResource extends ResourceFilter {

    @Override
    public void write(OutputStream outStream, LanguageBundle languageBundle,
            FilterOptions options) throws IOException, ResourceFilterException {

        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outStream, CHAR_SET));

        boolean globalNotesWritten = false;
        for (String globalNote : languageBundle.getNotes()) {
            writer.write(COMMENT_BEGIN+globalNote+COMMENT_END);
            writer.newLine();
            globalNotesWritten = true;
        }
        if (globalNotesWritten) {
            writer.newLine();
        }

        BreakIterator brkItr = Utils.getWordBreakIterator(options);

        for (ResourceString res : languageBundle.getSortedResourceStrings()) {
            // empties the buffer
            writer.write(formatEntry(res.getKey(), res.getValue(), res.getNotes(), brkItr));
        }

        writer.flush();
    }

}