Class ReusedBufferedIndexOutput

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    CachedIndexOutput

    public abstract class ReusedBufferedIndexOutput
    extends org.apache.lucene.store.IndexOutput
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Field Detail

      • buffer

        protected byte[] buffer
    • Constructor Detail

      • ReusedBufferedIndexOutput

        public ReusedBufferedIndexOutput​(String resourceDescription,
                                         String name)
      • ReusedBufferedIndexOutput

        public ReusedBufferedIndexOutput​(String resourceDescription,
                                         String name,
                                         int bufferSize)
    • Method Detail

      • getBufferStart

        protected long getBufferStart()
      • flushBufferToCache

        protected void flushBufferToCache()
                                   throws IOException
        Write the buffered bytes to cache
        Throws:
        IOException
      • getFilePointer

        public long getFilePointer()
        Specified by:
        getFilePointer in class org.apache.lucene.store.IndexOutput
      • writeByte

        public void writeByte​(byte b)
                       throws IOException
        Specified by:
        writeByte in class org.apache.lucene.store.DataOutput
        Throws:
        IOException
      • writeInternal

        protected abstract void writeInternal​(byte[] b,
                                              int offset,
                                              int length)
                                       throws IOException
        Expert: implements buffer flushing to cache. Writes bytes to the current position in the output.
        Parameters:
        b - the array of bytes to write
        offset - the offset in the array of bytes to write
        length - the number of bytes to write
        Throws:
        IOException
      • writeBytes

        public void writeBytes​(byte[] b,
                               int offset,
                               int length)
                        throws IOException
        Specified by:
        writeBytes in class org.apache.lucene.store.DataOutput
        Throws:
        IOException