Package org.apache.lucene.store
Class FSDirectory.FSIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.store.BufferedIndexOutput
-
- org.apache.lucene.store.FSDirectory.FSIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
- FSDirectory
protected static class FSDirectory.FSIndexOutput extends BufferedIndexOutput
Writes output withRandomAccessFile.write(byte[], int, int)
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.store.BufferedIndexOutput
DEFAULT_BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description FSIndexOutput(FSDirectory parent, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this stream to further operations.protected voidflushBuffer(byte[] b, int offset, int size)Expert: implements buffer write.longlength()The number of bytes in the file.voidseek(long pos)Random-access methodsvoidsetLength(long length)Set the file length.-
Methods inherited from class org.apache.lucene.store.BufferedIndexOutput
flush, getBufferSize, getFilePointer, writeByte, writeBytes
-
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeInt, writeLong, writeShort, writeString, writeStringSet, writeStringStringMap, writeVInt, writeVLong
-
-
-
-
Constructor Detail
-
FSIndexOutput
public FSIndexOutput(FSDirectory parent, String name) throws IOException
- Throws:
IOException
-
-
Method Detail
-
flushBuffer
protected void flushBuffer(byte[] b, int offset, int size) throws IOExceptionDescription copied from class:BufferedIndexOutputExpert: implements buffer write. Writes bytes at the current position in the output.- Specified by:
flushBufferin classBufferedIndexOutput- Parameters:
b- the bytes to writeoffset- the offset in the byte arraysize- the number of bytes to write- Throws:
IOException
-
close
public void close() throws IOExceptionDescription copied from class:IndexOutputCloses this stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classBufferedIndexOutput- Throws:
IOException
-
seek
public void seek(long pos) throws IOExceptionRandom-access methods- Overrides:
seekin classBufferedIndexOutput- Throws:
IOException- See Also:
IndexOutput.getFilePointer()
-
length
public long length() throws IOExceptionDescription copied from class:IndexOutputThe number of bytes in the file.- Specified by:
lengthin classBufferedIndexOutput- Throws:
IOException
-
setLength
public void setLength(long length) throws IOExceptionDescription copied from class:IndexOutputSet the file length. By default, this method does nothing (it's optional for a Directory to implement it). But, certain Directory implementations (for example @see FSDirectory) can use this to inform the underlying IO system to pre-allocate the file to the specified size. If the length is longer than the current file length, the bytes added to the file are undefined. Otherwise the file is truncated.- Overrides:
setLengthin classIndexOutput- Parameters:
length- file length- Throws:
IOException
-
-