org.gedcomx.util
Class JsonRecordSetWriter

java.lang.Object
  extended by org.gedcomx.util.JsonRecordSetWriter

public class JsonRecordSetWriter
extends Object

User: brenthale Date: 6/8/2015

Copyright FamilySearch.org


Field Summary
static String ID_STR
           
static String METADATA_STR
           
static String RECORDS_STR
           
 
Constructor Summary
JsonRecordSetWriter(OutputStream outputStream, Gedcomx metadata)
          Constructor.
 
Method Summary
 void close()
          Finish writing the file, including metadata (if set), and the closing tag.
 long getNumOfRecords()
           
 void writeRecord(Gedcomx record)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_STR

public static final String ID_STR
See Also:
Constant Field Values

METADATA_STR

public static final String METADATA_STR
See Also:
Constant Field Values

RECORDS_STR

public static final String RECORDS_STR
See Also:
Constant Field Values
Constructor Detail

JsonRecordSetWriter

public JsonRecordSetWriter(OutputStream outputStream,
                           Gedcomx metadata)
Constructor. Prepares to write GedcomX document records to the given output stream (which may well be a GZIPOutputStream), so that only one such document needs to be fully instantiated in memory at once.

Parameters:
outputStream - - OutputStream to write the Gedcomx document to.
metadata - - The metadata associated with this RecordSet. It will be written to the stream first.
Method Detail

writeRecord

public void writeRecord(Gedcomx record)
                 throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Finish writing the file, including metadata (if set), and the closing tag. Closes the writers and output stream.

Throws:
IOException

getNumOfRecords

public long getNumOfRecords()


Copyright © 2015. All rights reserved.