Search in sources :

Example 1 with MarcStreamWriter

use of org.marc4j.MarcStreamWriter in project RecordManager2 by moravianlibrary.

the class MarcRecordImpl method exportToIso2709.

protected String exportToIso2709() {
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    MarcWriter writer = new MarcStreamWriter(stream, "UTF-8", true);
    writer.write(record);
    writer.close();
    return new String(stream.toByteArray(), StandardCharsets.UTF_8);
}
Also used : MarcWriter(org.marc4j.MarcWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) MarcStreamWriter(org.marc4j.MarcStreamWriter)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 MarcStreamWriter (org.marc4j.MarcStreamWriter)1 MarcWriter (org.marc4j.MarcWriter)1