public final class Slices extends Object
| Modifier and Type | Field and Description |
|---|---|
static Slice |
EMPTY_SLICE
A slice with size
0. |
| Modifier and Type | Method and Description |
|---|---|
static Slice |
allocate(int capacity) |
static Slice |
allocateDirect(int capacity) |
static Slice |
copiedBuffer(String string,
Charset charset) |
static Slice |
copyOf(Slice slice) |
static Slice |
copyOf(Slice slice,
int offset,
int length) |
static Slice |
ensureSize(Slice existingSlice,
int minWritableBytes) |
static Slice |
mapFileReadOnly(File file) |
static Slice |
utf8Slice(String string) |
static Slice |
wrappedBooleanArray(boolean... array)
Creates a slice over the specified array.
|
static Slice |
wrappedBooleanArray(boolean[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
static Slice |
wrappedBuffer(byte... array)
Creates a slice over the specified array.
|
static Slice |
wrappedBuffer(byte[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
static Slice |
wrappedBuffer(ByteBuffer buffer)
Wrap the visible portion of a
ByteBuffer. |
static Slice |
wrappedDoubleArray(double... array)
Creates a slice over the specified array.
|
static Slice |
wrappedDoubleArray(double[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
static Slice |
wrappedFloatArray(float... array)
Creates a slice over the specified array.
|
static Slice |
wrappedFloatArray(float[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
static Slice |
wrappedIntArray(int... array)
Creates a slice over the specified array.
|
static Slice |
wrappedIntArray(int[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
static Slice |
wrappedLongArray(long... array)
Creates a slice over the specified array.
|
static Slice |
wrappedLongArray(long[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
static Slice |
wrappedShortArray(short... array)
Creates a slice over the specified array.
|
static Slice |
wrappedShortArray(short[] array,
int offset,
int length)
Creates a slice over the specified array range.
|
public static final Slice EMPTY_SLICE
0.public static Slice allocate(int capacity)
public static Slice allocateDirect(int capacity)
public static Slice wrappedBuffer(ByteBuffer buffer)
ByteBuffer.public static Slice wrappedBuffer(byte... array)
public static Slice wrappedBuffer(byte[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice wrappedBooleanArray(boolean... array)
public static Slice wrappedBooleanArray(boolean[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice wrappedShortArray(short... array)
public static Slice wrappedShortArray(short[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice wrappedIntArray(int... array)
public static Slice wrappedIntArray(int[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice wrappedLongArray(long... array)
public static Slice wrappedLongArray(long[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice wrappedFloatArray(float... array)
public static Slice wrappedFloatArray(float[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice wrappedDoubleArray(double... array)
public static Slice wrappedDoubleArray(double[] array, int offset, int length)
offset - the array position at which the slice beginslength - the number of array positions to include in the slicepublic static Slice mapFileReadOnly(File file) throws IOException
IOExceptionCopyright © 2012–2018. All rights reserved.