org.apache.lucene.store
Class IndexOutput
- java.lang.Object
-
- org.apache.lucene.store.IndexOutput
-
- Direct Known Subclasses:
- BufferedIndexOutput, RAMOutputStream
public abstract class IndexOutput extends java.lang.ObjectAbstract base class for output to a file in a Directory. A random-access output stream. Used for all Lucene index output operations.- See Also:
Directory,IndexInput
-
-
Constructor Summary
Constructors Constructor and Description IndexOutput()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidclose()Closes this stream to further operations.voidcopyBytes(IndexInput input, long numBytes)Copy numBytes bytes from input to ourself.abstract voidflush()Forces any buffered output to be written.abstract longgetFilePointer()Returns the current position in this file, where the next write will occur.abstract longlength()The number of bytes in the file.abstract voidseek(long pos)Sets current position in this file, where the next write will occur.abstract voidwriteByte(byte b)Writes a single byte.voidwriteBytes(byte[] b, int length)Writes an array of bytes.abstract voidwriteBytes(byte[] b, int offset, int length)Writes an array of bytes.voidwriteChars(char[] s, int start, int length)Writes a sequence of UTF-8 encoded characters from a char[].voidwriteChars(java.lang.String s, int start, int length)Writes a sequence of UTF-8 encoded characters from a string.voidwriteInt(int i)Writes an int as four bytes.voidwriteLong(long i)Writes a long as eight bytes.voidwriteString(java.lang.String s)Writes a string.voidwriteVInt(int i)Writes an int in a variable-length format.voidwriteVLong(long i)Writes an long in a variable-length format.
-
-
-
Method Detail
-
writeByte
public abstract void writeByte(byte b) throws java.io.IOExceptionWrites a single byte.- Throws:
java.io.IOException- See Also:
IndexInput.readByte()
-
writeBytes
public void writeBytes(byte[] b, int length) throws java.io.IOExceptionWrites an array of bytes.- Parameters:
b- the bytes to writelength- the number of bytes to write- Throws:
java.io.IOException- See Also:
IndexInput.readBytes(byte[],int,int)
-
writeBytes
public abstract void writeBytes(byte[] b, int offset, int length) throws java.io.IOExceptionWrites an array of bytes.- Parameters:
b- the bytes to writeoffset- the offset in the byte arraylength- the number of bytes to write- Throws:
java.io.IOException- See Also:
IndexInput.readBytes(byte[],int,int)
-
writeInt
public void writeInt(int i) throws java.io.IOExceptionWrites an int as four bytes.- Throws:
java.io.IOException- See Also:
IndexInput.readInt()
-
writeVInt
public void writeVInt(int i) throws java.io.IOExceptionWrites an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.- Throws:
java.io.IOException- See Also:
IndexInput.readVInt()
-
writeLong
public void writeLong(long i) throws java.io.IOExceptionWrites a long as eight bytes.- Throws:
java.io.IOException- See Also:
IndexInput.readLong()
-
writeVLong
public void writeVLong(long i) throws java.io.IOExceptionWrites an long in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.- Throws:
java.io.IOException- See Also:
IndexInput.readVLong()
-
writeString
public void writeString(java.lang.String s) throws java.io.IOExceptionWrites a string.- Throws:
java.io.IOException- See Also:
IndexInput.readString()
-
writeChars
public void writeChars(java.lang.String s, int start, int length) throws java.io.IOExceptionWrites a sequence of UTF-8 encoded characters from a string.- Parameters:
s- the source of the charactersstart- the first character in the sequencelength- the number of characters in the sequence- Throws:
java.io.IOException- See Also:
IndexInput.readChars(char[],int,int)
-
writeChars
public void writeChars(char[] s, int start, int length) throws java.io.IOExceptionWrites a sequence of UTF-8 encoded characters from a char[].- Parameters:
s- the source of the charactersstart- the first character in the sequencelength- the number of characters in the sequence- Throws:
java.io.IOException- See Also:
IndexInput.readChars(char[],int,int)
-
copyBytes
public void copyBytes(IndexInput input, long numBytes) throws java.io.IOException
Copy numBytes bytes from input to ourself.- Throws:
java.io.IOException
-
flush
public abstract void flush() throws java.io.IOExceptionForces any buffered output to be written.- Throws:
java.io.IOException
-
close
public abstract void close() throws java.io.IOExceptionCloses this stream to further operations.- Throws:
java.io.IOException
-
getFilePointer
public abstract long getFilePointer()
Returns the current position in this file, where the next write will occur.- See Also:
seek(long)
-
seek
public abstract void seek(long pos) throws java.io.IOExceptionSets current position in this file, where the next write will occur.- Throws:
java.io.IOException- See Also:
getFilePointer()
-
length
public abstract long length() throws java.io.IOExceptionThe number of bytes in the file.- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG