All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deephaven.chunk.ChunkStream Maven / Gradle / Ivy

The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.chunk;

import io.deephaven.chunk.attributes.Any;

import java.util.Arrays;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.LongStream;

public class ChunkStream {
    public static DoubleStream of(DoubleChunk chunk, int offset, int capacity) {
        ChunkHelpers.checkSliceArgs(chunk.size, offset, capacity);
        return Arrays.stream(chunk.data, chunk.offset + offset, chunk.offset + offset + capacity);
    }

    public static IntStream of(IntChunk chunk, int offset, int capacity) {
        ChunkHelpers.checkSliceArgs(chunk.size, offset, capacity);
        return Arrays.stream(chunk.data, chunk.offset + offset, chunk.offset + offset + capacity);
    }

    public static LongStream of(LongChunk chunk, int offset, int capacity) {
        ChunkHelpers.checkSliceArgs(chunk.size, offset, capacity);
        return Arrays.stream(chunk.data, chunk.offset + offset, chunk.offset + offset + capacity);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy