org.apache.lucene.store
Class IndexOutput
public abstract class IndexOutput
Abstract base class for output to a file in a Directory. A random-access
output stream. Used for all Lucene index output operations.
abstract void | close()- Closes this stream to further operations.
|
abstract void | flush()- Forces any buffered output to be written.
|
abstract long | getFilePointer()- Returns the current position in this file, where the next write will
occur.
|
abstract long | length()- The number of bytes in the file.
|
abstract void | seek(long pos)- Sets current position in this file, where the next write will occur.
|
abstract void | writeByte(byte b)- Writes a single byte.
|
abstract void | writeBytes(byte[] b, int length)- Writes an array of bytes.
|
void | writeChars(String s, int start, int length)- Writes a sequence of UTF-8 encoded characters from a string.
|
void | writeInt(int i)- Writes an int as four bytes.
|
void | writeLong(long i)- Writes a long as eight bytes.
|
void | writeString(String s)- Writes a string.
|
void | writeVInt(int i)- Writes an int in a variable-length format.
|
void | writeVLong(long i)- Writes an long in a variable-length format.
|
close
public abstract void close()
throws IOExceptionCloses this stream to further operations.
flush
public abstract void flush()
throws IOExceptionForces any buffered output to be written.
getFilePointer
public abstract long getFilePointer()
Returns the current position in this file, where the next write will
occur.
length
public abstract long length()
throws IOExceptionThe number of bytes in the file.
seek
public abstract void seek(long pos)
throws IOExceptionSets current position in this file, where the next write will occur.
writeByte
public abstract void writeByte(byte b)
throws IOExceptionWrites a single byte.
writeBytes
public abstract void writeBytes(byte[] b,
int length)
throws IOExceptionWrites an array of bytes.
b - the bytes to writelength - the number of bytes to write
writeChars
public void writeChars(String s,
int start,
int length)
throws IOExceptionWrites a sequence of UTF-8 encoded characters from a string.
s - the source of the charactersstart - the first character in the sequencelength - the number of characters in the sequence
writeInt
public void writeInt(int i)
throws IOExceptionWrites an int as four bytes.
writeLong
public void writeLong(long i)
throws IOExceptionWrites a long as eight bytes.
writeString
public void writeString(String s)
throws IOExceptionWrites a string.
writeVInt
public void writeVInt(int i)
throws IOExceptionWrites an int in a variable-length format. Writes between one and
five bytes. Smaller values take fewer bytes. Negative numbers are not
supported.
writeVLong
public void writeVLong(long i)
throws IOExceptionWrites an long in a variable-length format. Writes between one and five
bytes. Smaller values take fewer bytes. Negative numbers are not
supported.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.