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 SlicecopiedBuffer(String string, Charset charset) static SliceensureSize(Slice existingSlice, int minWritableBytes) static Slicerandom(int capacity) Allocates a new slice containing random bytes from ThreadLocalRandom.static SliceAllocates a new slice containing random bytes.static Slicestatic 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 SlicewrappedHeapBuffer(ByteBuffer buffer)
-
Field Details
-
EMPTY_SLICE
A slice with size0.
-
-
Method Details
-
ensureSize
-
allocate
-
random
Allocates a new slice containing random bytes from ThreadLocalRandom. -
random
Allocates a new slice containing random bytes. -
wrappedHeapBuffer
-
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
-
copiedBuffer
-
utf8Slice
-