|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Chunk.Writer
This interface specifies the methods that must be implemented by a class that writes chunk data to a
data output. The data output is likely to be an instance of java.io.RandomAccessFile
.
The Document.write(java.io.File)
method, which is provided as a
standard way of writing a Nested List File, writes a document in two passes. It uses the value that
is returned by the reset(int)
method on the first pass to determine whether a
chunk should be rewritten on the second pass.
Chunk.getWriter()
,
Chunk.setWriter(Chunk.Writer)
Method Summary | |
---|---|
long |
getLength()
Returns the length (size) of the chunk in bytes. |
boolean |
reset(int pass)
Resets the chunk writer before any writing is performed. |
void |
write(java.io.DataOutput dataOutput)
Writes the chunk data to the specified data output. |
Method Detail |
---|
boolean reset(int pass) throws java.io.IOException
pass
- the index of the pass (0 = first pass, 1 = second pass) of the document writer that
calls this method.
true
on the first pass if the chunk should be rewritten on the second pass;
false
otherwise.
java.io.IOException
- if an I/O error occurs.long getLength()
void write(java.io.DataOutput dataOutput) throws java.io.IOException
java.io.RandomAccessFile
.
dataOutput
- the data output to which the chunk data are to be written.
java.io.IOException
- if an I/O error occurs.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |