Package org.iq80.leveldb.util
Class Slices
java.lang.Object
org.iq80.leveldb.util.Slices
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<Map<Charset, CharsetDecoder>> static final SliceA buffer whose capacity is0.private static final ThreadLocal<Map<Charset, CharsetEncoder>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Sliceallocate(int capacity) static SlicecopiedBuffer(String string, Charset charset) static SlicecopiedBuffer(ByteBuffer source) static SlicecopiedBuffer(ByteBuffer source, int sourceOffset, int length) static StringdecodeString(ByteBuffer src, Charset charset) static ByteBufferencodeString(CharBuffer src, Charset charset) static SliceensureSize(Slice existingSlice, int minWritableBytes) private static CharsetDecodergetDecoder(Charset charset) Returns a cached thread-localCharsetDecoderfor the specified charset.private static CharsetEncodergetEncoder(Charset charset) Returns a cached thread-localCharsetEncoderfor the specified charset.static SlicereadLengthPrefixedBytes(SliceInput sliceInput) static SlicewrappedBuffer(byte[] array) static voidwriteLengthPrefixedBytes(SliceOutput sliceOutput, Slice value)
-
Field Details
-
EMPTY_SLICE
A buffer whose capacity is0. -
encoders
-
decoders
-
-
Constructor Details
-
Slices
private Slices()
-
-
Method Details
-
readLengthPrefixedBytes
-
writeLengthPrefixedBytes
-
ensureSize
-
allocate
-
wrappedBuffer
-
copiedBuffer
-
copiedBuffer
-
copiedBuffer
-
encodeString
-
decodeString
-
getEncoder
Returns a cached thread-localCharsetEncoderfor the specified charset. -
getDecoder
Returns a cached thread-localCharsetDecoderfor the specified charset.
-