Class VectorReader

java.lang.Object
uk.co.parnmatt.vector.reader.VectorReader

public final class VectorReader extends Object

Composes a reader over binary encoded vectors, choosing a Source, a buffering strategy, and the element type to decode.

try (CloseableIterator<float[]> vectors = VectorReader.from(Source.file(path))
        .fixed(Buffers.heap(1 << 16))
        .as(ElementType.FLOAT32)) {
    ...
}
Since:
0.4.0
  • Method Details

    • from

      public static VectorReader.Buffering from(Source source)
      Begin composing a reader over the given source.
      Parameters:
      source - the source of binary encoded vector bytes
      Returns:
      the choice of buffering strategy