Top Description Fields Constructors Methods
org.jboss.jandex

public final Class IndexWriter

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream

Writes a Jandex index file to a stream. The write process is somewhat more expensive to allow for fast reads and a compact size. For more information on the index content, see the documentation on Indexer.

The IndexWriter operates on standard output streams, and also provides suitable buffering.

Thread-Safety

IndexWriter is not thread-safe and can not be shared between concurrent threads.
Author
Jason T. Greene
See Also
Indexer, Index

Field Summary

Modifier and TypeField and Description
private final OutputStream

Constructor Summary

AccessConstructor and Description
public
IndexWriter(OutputStream
a stream to write an index to
out
)

Constructs an IndexWriter using the specified stream

Method Summary

Modifier and TypeMethod and Description
private IndexWriterImpl
getWriter(int version)

public int

Returns:

the number of bytes written to the stream
write
(Index
the index to write to the stream
index
)

Writes the specified index to the associated output stream.

public int

Returns:

the number of bytes written to the stream
write
(Index
the index to write to the stream
index
,
byte
the index file version
version
)

Deprecated
Writes the specified index to the associated output stream.
public int

Returns:

the number of bytes written to the stream
write
(Index
the index to write to the stream
index
,
int
the index file version
version
)

Writes the specified index to the associated output stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

outback to summary
private final OutputStream out

Constructor Detail

IndexWriterback to summary
public IndexWriter(OutputStream out)

Constructs an IndexWriter using the specified stream

Parameters
out:OutputStream

a stream to write an index to

Method Detail

getWriterback to summary
private IndexWriterImpl getWriter(int version)
writeback to summary
public int write(Index index) throws IOException

Writes the specified index to the associated output stream. This may be called multiple times in order to write multiple indexes. The default version of index file is used.

Parameters
index:Index

the index to write to the stream

Returns:int

the number of bytes written to the stream

Exceptions
IOException:
if the underlying stream fails
writeback to summary
public int write(Index index, byte version) throws IOException

Deprecated

Writes the specified index to the associated output stream. This may be called multiple times in order to write multiple indexes.

Parameters
index:Index

the index to write to the stream

version:byte

the index file version

Returns:int

the number of bytes written to the stream

Annotations
@Deprecated
Exceptions
IOException:
if any i/o error occurs
writeback to summary
public int write(Index index, int version) throws IOException

Writes the specified index to the associated output stream. This may be called multiple times in order to write multiple indexes.

Parameters
index:Index

the index to write to the stream

version:int

the index file version

Returns:int

the number of bytes written to the stream

Exceptions
IOException:
if any i/o error occurs