Class SimpleTextStoredFieldsWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Accountable

    public class SimpleTextStoredFieldsWriter
    extends StoredFieldsWriter
    Writes plain-text stored fields.

    FOR RECREATIONAL USE ONLY

    • Constructor Detail

      • SimpleTextStoredFieldsWriter

        public SimpleTextStoredFieldsWriter​(Directory directory,
                                            java.lang.String segment,
                                            IOContext context)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • finish

        public void finish​(int numDocs)
                    throws java.io.IOException
        Description copied from class: StoredFieldsWriter
        Called before StoredFieldsWriter.close(), passing in the number of documents that were written. Note that this is intentionally redundant (equivalent to the number of calls to StoredFieldsWriter.startDocument(), but a Codec should check that this is the case to detect the JRE bug described in LUCENE-1282.
        Specified by:
        finish in class StoredFieldsWriter
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class StoredFieldsWriter
        Throws:
        java.io.IOException
      • write

        private void write​(java.lang.String s)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        private void write​(BytesRef bytes)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • newLine

        private void newLine()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.