io.deephaven.chunk.util.factories.ByteChunkFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-chunk Show documentation
Show all versions of deephaven-engine-chunk Show documentation
Engine Chunks: Array-like data structures for dense, efficient data movement
The newest version!
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
// ****** AUTO-GENERATED CLASS - DO NOT EDIT MANUALLY
// ****** Edit CharChunkFactory and run "./gradlew replicateSourcesAndChunks" to regenerate
//
// @formatter:off
package io.deephaven.chunk.util.factories;
import io.deephaven.chunk.*;
import io.deephaven.chunk.attributes.Any;
import org.jetbrains.annotations.NotNull;
import java.util.function.IntFunction;
public class ByteChunkFactory implements ChunkFactory {
@NotNull
@Override
public final byte[] makeArray(int capacity) {
return ByteChunk.makeArray(capacity);
}
@NotNull
@Override
public final ByteChunk[] makeChunkArray(int capacity) {
return ByteChunkChunk.makeArray(capacity);
}
@NotNull
@Override
public final ByteChunk getEmptyChunk() {
return ByteChunk.getEmptyChunk();
}
@NotNull
@Override
public final ByteChunkChunk getEmptyChunkChunk() {
return ByteChunkChunk.getEmptyChunk();
}
@NotNull
@Override
public final ByteChunk chunkWrap(Object array) {
final byte[] typedArray = (byte[]) array;
return ByteChunk.chunkWrap(typedArray);
}
@NotNull
@Override
public final ByteChunk chunkWrap(Object array, int offset, int capacity) {
final byte[] typedArray = (byte[]) array;
return ByteChunk.chunkWrap(typedArray, offset, capacity);
}
@NotNull
@Override
public final ByteChunkChunk chunkChunkWrap(Chunk[] array) {
ByteChunk[] typedArray = (ByteChunk[]) array;
return ByteChunkChunk.chunkWrap(typedArray);
}
@NotNull
@Override
public final ByteChunkChunk chunkChunkWrap(Chunk[] array, int offset, int capacity) {
ByteChunk[] typedArray = (ByteChunk[]) array;
return ByteChunkChunk.chunkWrap(typedArray, offset, capacity);
}
@NotNull
@Override
public final ResettableReadOnlyChunk makeResettableReadOnlyChunk() {
return ResettableByteChunk.makeResettableChunk();
}
@NotNull
@Override
public final ResettableChunkChunk makeResettableChunkChunk() {
return ResettableByteChunkChunk.makeResettableChunk();
}
@NotNull
@Override
public final WritableByteChunk makeWritableChunk(int capacity) {
return WritableByteChunk.makeWritableChunk(capacity);
}
@NotNull
@Override
public final WritableByteChunkChunk makeWritableChunkChunk(int capacity) {
return WritableByteChunkChunk.makeWritableChunk(capacity);
}
@NotNull
@Override
public final WritableByteChunk writableChunkWrap(Object array, int offset, int capacity) {
final byte[] realType = (byte[]) array;
return WritableByteChunk.writableChunkWrap(realType, offset, capacity);
}
@NotNull
@Override
public final WritableChunkChunk writableChunkChunkWrap(WritableChunk[] array,
int offset, int capacity) {
WritableByteChunk[] actual = (WritableByteChunk[]) array;
return WritableByteChunkChunk.writableChunkWrap(actual, offset, capacity);
}
@NotNull
@Override
public final ResettableWritableChunk makeResettableWritableChunk() {
return ResettableWritableByteChunk.makeResettableChunk();
}
@NotNull
@Override
public final ResettableWritableChunkChunk makeResettableWritableChunkChunk() {
return ResettableWritableByteChunkChunk.makeResettableChunk();
}
@NotNull
@Override
public final IntFunction chunkArrayBuilder() {
return ByteChunk[]::new;
}
@NotNull
public final IntFunction writableChunkArrayBuilder() {
return WritableByteChunk[]::new;
}
}