public final class Slices extends Object
Modifier and Type | Field and Description |
---|---|
static Slice |
EMPTY_SLICE
A buffer whose capacity is
0 . |
Modifier and Type | Method and Description |
---|---|
static Slice |
allocate(int capacity) |
static Slice |
copiedBuffer(ByteBuffer source) |
static Slice |
copiedBuffer(ByteBuffer source,
int sourceOffset,
int length) |
static Slice |
copiedBuffer(String string,
Charset charset) |
static String |
decodeString(ByteBuffer src,
Charset charset) |
static ByteBuffer |
encodeString(CharBuffer src,
Charset charset) |
static Slice |
ensureSize(Slice existingSlice,
int minWritableBytes) |
static Slice |
readLengthPrefixedBytes(SliceInput sliceInput) |
static Slice |
wrappedBuffer(byte[] array) |
static void |
writeLengthPrefixedBytes(SliceOutput sliceOutput,
Slice value) |
public static final Slice EMPTY_SLICE
0
.public static Slice readLengthPrefixedBytes(SliceInput sliceInput)
public static void writeLengthPrefixedBytes(SliceOutput sliceOutput, Slice value)
public static Slice allocate(int capacity)
public static Slice wrappedBuffer(byte[] array)
public static Slice copiedBuffer(ByteBuffer source, int sourceOffset, int length)
public static Slice copiedBuffer(ByteBuffer source)
public static ByteBuffer encodeString(CharBuffer src, Charset charset)
public static String decodeString(ByteBuffer src, Charset charset)
Copyright © 2011–2019. All rights reserved.