Package org.apache.maven.index.reader
Class ChunkWriter
java.lang.Object
org.apache.maven.index.reader.ChunkWriter
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Maven Index published binary chunk writer, it writes raw Maven Indexer records to the transport binary format.
 Instances of this class MUST BE handled as resources (have them closed once done with them), it is user
 responsibility to close them, ideally in try-with-resource block.
- Since:
- 5.1.2
- 
Constructor SummaryConstructorsConstructorDescriptionChunkWriter(String chunkName, OutputStream outputStream, int version, Date timestamp) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes this reader and it's underlying input.getName()Returns the chunk name.Returns the index timestamp of last update of the index.intReturns index version.intwriteChunk(Iterator<Map<String, String>> iterator) Writes out the record iterator and returns the written record count.
- 
Constructor Details- 
ChunkWriterpublic ChunkWriter(String chunkName, OutputStream outputStream, int version, Date timestamp) throws IOException - Throws:
- IOException
 
 
- 
- 
Method Details- 
getNameReturns the chunk name.
- 
getVersionpublic int getVersion()Returns index version. All releases so far always returned1.
- 
getTimestampReturns the index timestamp of last update of the index.
- 
writeChunkWrites out the record iterator and returns the written record count.- Throws:
- IOException
 
- 
closeCloses this reader and it's underlying input.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-