Package org.eclipse.mat.parser.index

# Class IndexWriter.LongIndexStreamer

java.lang.Object
org.eclipse.mat.parser.index.IndexWriter.LongIndexStreamer

Enclosing class:
  `IndexWriter`

public static class IndexWriter.LongIndexStreamer extends Object
A helper class to output a list of longs.

## Constructor Summary

Constructors
Constructor
Description
`LongIndexStreamer()`
A simple constructor.
`LongIndexStreamer(File indexFile)`
Construct a streamer which outputs to a file

## Method Summary

Modifier and Type
Method
Description
`void`
`add(long value)`
`void`
`addAll(long[] values)`
`void`
`addAll(long[] values, int offset, int length)`
`void`
`addAll(ArrayLong array)`
`void`
`addAll(IteratorLong iterator)`
`void`
`close()`
Close the backing file.
`long`
`get(int index)`
`long[]`
`getNext(int index, int length)`
`IteratorLong`
`iterator()`
`int`
`reverse(long value)`
`void`
`set(int index, long value)`
`int`
`size()`
`void`
`unload()`
`IIndexReader.IOne2LongIndex`
`writeTo(File indexFile, int size, HashMapIntObject<Object> pages, int pageSize)`
`IIndexReader.IOne2LongIndex`
`writeTo(File indexFile, long[] array)`
Output a whole long array
`IIndexReader.IOne2LongIndex`
`writeTo(File indexFile, ArrayLong array)`
Output a whole ArrayLong
`IIndexReader.IOne2LongIndex`
`writeTo(File indexFile, IteratorLong iterator)`
Output a whole long iterator

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LongIndexStreamer

public LongIndexStreamer()
A simple constructor.

### LongIndexStreamer

public LongIndexStreamer(File indexFile) throws IOException
Construct a streamer which outputs to a file

Parameters:
  `indexFile` - the output file
Throws:
  `IOException` - if a problem occurs with a write

## Method Details

### close

public void close() throws IOException
Close the backing file.

Throws:
  `IOException` - if a problem occurs with the write or close.

### writeTo

public IIndexReader.IOne2LongIndex writeTo(File indexFile, int size, HashMapIntObject<Object> pages, int pageSize) throws IOException

Throws:
  `IOException`

### writeTo

public IIndexReader.IOne2LongIndex writeTo(File indexFile, long[] array) throws IOException
Output a whole long array

Parameters:
  `indexFile` - the output file
  `array` - the source data
Returns:
  a reader for the data
Throws:
  `IOException` - if a problem occurred with the write

### writeTo

public IIndexReader.IOne2LongIndex writeTo(File indexFile, IteratorLong iterator) throws IOException
Output a whole long iterator

Parameters:
  `indexFile` - the output file
  `iterator` - the source data
Returns:
  a reader for the data
Throws:
  `IOException` - if a problem occurred with the write

### writeTo

public IIndexReader.IOne2LongIndex writeTo(File indexFile, ArrayLong array) throws IOException
Output a whole ArrayLong

Parameters:
  `indexFile` - the output file
  `array` - the source data
Returns:
  a reader for the data
Throws:
  `IOException` - if a problem occurred with the write

### addAll

public void addAll(IteratorLong iterator) throws IOException

Throws:
  `IOException`

### addAll

public void addAll(ArrayLong array) throws IOException

Throws:
  `IOException`

### add

public void add(long value) throws IOException

Throws:
  `IOException`

### addAll

public void addAll(long[] values) throws IOException

Throws:
  `IOException`

### addAll

public void addAll(long[] values, int offset, int length) throws IOException

Throws:
  `IOException`

### get

public long get(int index)

### getNext

public long[] getNext(int index, int length)

### reverse

public int reverse(long value)

### set

public void set(int index, long value)

### unload

public void unload()

### size

public int size()

### iterator

public IteratorLong iterator()