Package org.apache.lucene.store
Class IndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
ByteBuffersIndexOutput
,OutputStreamIndexOutput
,RAMOutputStream
,RateLimitedIndexOutput
public abstract class IndexOutput extends DataOutput implements Closeable
ADataOutput
for appending data to a file in aDirectory
. Instances of this class are not thread-safe.- See Also:
Directory
,IndexInput
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
IndexOutput(String resourceDescription, String name)
Sole constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
close()
Closes this stream to further operations.abstract long
getChecksum()
Returns the current checksum of bytes written so farabstract long
getFilePointer()
Returns the current position in this file, where the next write will occur.String
getName()
Returns the name used to create thisIndexOutput
.String
toString()
-
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeByte, writeBytes, writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
-
-
-
Constructor Detail
-
IndexOutput
protected IndexOutput(String resourceDescription, String name)
Sole constructor. resourceDescription should be non-null, opaque string describing this resource; it's returned fromtoString()
.
-
-
Method Detail
-
getName
public String getName()
Returns the name used to create thisIndexOutput
. This is especially useful when usingDirectory.createTempOutput(java.lang.String, java.lang.String, org.apache.lucene.store.IOContext)
.
-
close
public abstract void close() throws IOException
Closes this stream to further operations.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getFilePointer
public abstract long getFilePointer()
Returns the current position in this file, where the next write will occur.
-
getChecksum
public abstract long getChecksum() throws IOException
Returns the current checksum of bytes written so far- Throws:
IOException
-
-