Package io.airlift.slice
Class Slices
java.lang.Object
io.airlift.slice.Slices
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Sliceallocate(int capacity) static SliceallocateDirect(int capacity) static SlicecopiedBuffer(String string, Charset charset) static Slicestatic Slicestatic SliceensureSize(Slice existingSlice, int minWritableBytes) static SlicemapFileReadOnly(File file) static Slicestatic SlicewrappedBooleanArray(boolean... array) Creates a slice over the specified array.static SlicewrappedBooleanArray(boolean[] array, int offset, int length) Creates a slice over the specified array range.static SlicewrappedBuffer(byte... array) Creates a slice over the specified array.static SlicewrappedBuffer(byte[] array, int offset, int length) Creates a slice over the specified array range.static SlicewrappedBuffer(ByteBuffer buffer) Wrap the visible portion of aByteBuffer.static SlicewrappedDoubleArray(double... array) Creates a slice over the specified array.static SlicewrappedDoubleArray(double[] array, int offset, int length) Creates a slice over the specified array range.static SlicewrappedFloatArray(float... array) Creates a slice over the specified array.static SlicewrappedFloatArray(float[] array, int offset, int length) Creates a slice over the specified array range.static SlicewrappedIntArray(int... array) Creates a slice over the specified array.static SlicewrappedIntArray(int[] array, int offset, int length) Creates a slice over the specified array range.static SlicewrappedLongArray(long... array) Creates a slice over the specified array.static SlicewrappedLongArray(long[] array, int offset, int length) Creates a slice over the specified array range.static SlicewrappedShortArray(short... array) Creates a slice over the specified array.static SlicewrappedShortArray(short[] array, int offset, int length) Creates a slice over the specified array range.
-
Field Details
-
EMPTY_SLICE
A slice with size0.
-
-
Method Details
-
ensureSize
-
allocate
-
allocateDirect
-
copyOf
-
copyOf
-
wrappedBuffer
Wrap the visible portion of aByteBuffer. -
wrappedBuffer
Creates a slice over the specified array. -
wrappedBuffer
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
wrappedBooleanArray
Creates a slice over the specified array. -
wrappedBooleanArray
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
wrappedShortArray
Creates a slice over the specified array. -
wrappedShortArray
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
wrappedIntArray
Creates a slice over the specified array. -
wrappedIntArray
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
wrappedLongArray
Creates a slice over the specified array. -
wrappedLongArray
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
wrappedFloatArray
Creates a slice over the specified array. -
wrappedFloatArray
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
wrappedDoubleArray
Creates a slice over the specified array. -
wrappedDoubleArray
Creates a slice over the specified array range.- Parameters:
offset- the array position at which the slice beginslength- the number of array positions to include in the slice
-
copiedBuffer
-
utf8Slice
-
mapFileReadOnly
- Throws:
IOException
-