|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.indexer.postings.io.StreamPostingsOutput
public class StreamPostingsOutput
A postings output that writes the postings to an output stream. This stream should be buffered for the best performance.
Field Summary | |
---|---|
protected long |
offset
The current offset in the stream. |
protected java.io.OutputStream |
stream
The stream to which we will write our postings. |
Constructor Summary | |
---|---|
StreamPostingsOutput(java.io.OutputStream stream)
Creates a postings output from the given stream. |
|
StreamPostingsOutput(java.io.OutputStream stream,
long offset)
Creates a postings output from the given stream. |
Method Summary | |
---|---|
void |
close()
Closes the output stream |
void |
flush()
Flushes any buffered output to the underlying storage. |
long |
position()
Gets the position of the current output. |
int |
write(WriteableBuffer b)
Writes out the given buffer of postings. |
long |
write(WriteableBuffer[] b)
Writes a set of postings encoded onto a number of buffers. |
long |
write(WriteableBuffer[] b,
int offset,
int length)
Writes a subsequence of a set of postings encoded onto a number of buffers to the output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.OutputStream stream
protected long offset
Constructor Detail |
---|
public StreamPostingsOutput(java.io.OutputStream stream)
stream
- The stream to which postings will be written.public StreamPostingsOutput(java.io.OutputStream stream, long offset)
stream
- The stream to which postings will be written.offset
- The initial offset for the stream.Method Detail |
---|
public int write(WriteableBuffer b) throws java.io.IOException
write
in interface PostingsOutput
b
- A buffer of postings to write.
java.io.IOException
- if there is any error writing the
postings.public long write(WriteableBuffer[] b) throws java.io.IOException
write
in interface PostingsOutput
b
- The buffers to write.
java.io.IOException
- if there is any error writing the
postings.public long write(WriteableBuffer[] b, int offset, int length) throws java.io.IOException
write
in interface PostingsOutput
b
- The buffers to write.offset
- The offset in b
where we will begin
writing bytes.length
- The length of the subsequence of b
for
which we will write postings.
java.io.IOException
- if there is any error writing the
postings.public long position() throws java.io.IOException
position
in interface PostingsOutput
java.io.IOException
- if there is any error.public void flush() throws java.io.IOException
flush
in interface PostingsOutput
java.io.IOException
- if there is any error flushing the
postings.public void close() throws java.io.IOException
java.io.IOException
- if there is an error closing the stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |