class POTResource extends ResourceFilter {

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

        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outStream, CHAR_SET));
        List<ResourceString> resStrings = languageBundle.getSortedResourceStrings();
        BreakIterator brkItr = Utils.getWordBreakIterator(options);

        // write header
        writer.write(getHeader());

        for (ResourceString res : resStrings) {
            // write entry in format:
            // msgid "untranslated-string"
            // msgstr ""
            writer.newLine();
            writer.write(formatMessage(UNTRANSLATED_STRING_PREFIX, res.getKey(), brkItr));
            writer.write(TRANSLATED_STRING_PREFIX);
            writer.write("\"\"");
            writer.newLine();
        }

        writer.flush();
    }

}