Package io.activej.bytebuf
Class ByteBufStrings
java.lang.Object
io.activej.bytebuf.ByteBufStrings
This class contains various fast string utilities for
ByteBufs and byte arrays-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic Stringstatic StringdecodeAscii(byte[] array) static StringdecodeAscii(byte[] array, int pos, int len) static StringdecodeAscii(byte[] array, int pos, int len, char[] tmpBuffer) static intdecodeInt(byte[] array, int pos, int len) static longdecodeLong(byte[] array, int pos, int len) static intdecodePositiveInt(byte[] array, int pos, int len) static longdecodePositiveLong(byte[] array, int pos, int len) static StringdecodeUtf8(byte[] array) static StringdecodeUtf8(byte[] array, int pos, int len) static StringdecodeUtf8(ByteBuf buf) static intencodeAscii(byte[] array, int pos, String string) static byte[]encodeAscii(String string) static intencodeInt(byte[] array, int pos, int value) static intencodeLong(byte[] array, int pos, long value) static intencodePositiveInt(byte[] array, int pos, int value) static intencodePositiveLong(byte[] array, int pos, long value) static intencodeUtf8(byte[] array, int offset, String string) static booleanequalsLowerCaseAscii(byte[] lowerCasePattern, byte[] array, int offset, int size) static booleanequalsUpperCaseAscii(byte[] upperCasePattern, byte[] array, int offset, int size) static inthashCode(byte[] array) static inthashCode(byte[] array, int offset, int size) static intstatic inthashCodeLowerCaseAscii(byte[] array) static inthashCodeLowerCaseAscii(byte[] array, int offset, int size) static intstatic inthashCodeUpperCaseAscii(byte[] array) static inthashCodeUpperCaseAscii(byte[] array, int offset, int size) static intstatic voidstatic voidstatic voidstatic voidputPositiveInt(ByteBuf buf, int value) static voidputPositiveLong(ByteBuf buf, long value) static voidstatic voidtoLowerCaseAscii(byte[] bytes) static voidtoLowerCaseAscii(byte[] bytes, int pos, int len) static voidtoLowerCaseAscii(ByteBuf buf) static voidtoUpperCaseAscii(byte[] bytes) static voidtoUpperCaseAscii(byte[] bytes, int pos, int len) static voidtoUpperCaseAscii(ByteBuf buf) static ByteBufstatic ByteBufwrapInt(int value) static ByteBufwrapLong(long value) static ByteBuf
-
Field Details
-
CR
public static final byte CR- See Also:
-
LF
public static final byte LF- See Also:
-
SP
public static final byte SP- See Also:
-
HT
public static final byte HT- See Also:
-
-
Constructor Details
-
ByteBufStrings
public ByteBufStrings()
-
-
Method Details
-
encodeAscii
-
encodeAscii
-
putAscii
-
wrapAscii
-
decodeAscii
-
decodeAscii
-
asAscii
-
decodeAscii
-
toLowerCaseAscii
public static void toLowerCaseAscii(byte[] bytes, int pos, int len) -
toLowerCaseAscii
public static void toLowerCaseAscii(byte[] bytes) -
toLowerCaseAscii
-
toUpperCaseAscii
public static void toUpperCaseAscii(byte[] bytes, int pos, int len) -
toUpperCaseAscii
public static void toUpperCaseAscii(byte[] bytes) -
toUpperCaseAscii
-
equalsLowerCaseAscii
public static boolean equalsLowerCaseAscii(byte[] lowerCasePattern, byte[] array, int offset, int size) -
equalsUpperCaseAscii
public static boolean equalsUpperCaseAscii(byte[] upperCasePattern, byte[] array, int offset, int size) -
hashCode
public static int hashCode(byte[] array, int offset, int size) -
hashCode
public static int hashCode(byte[] array) -
hashCode
-
hashCodeLowerCaseAscii
public static int hashCodeLowerCaseAscii(byte[] array, int offset, int size) -
hashCodeLowerCaseAscii
public static int hashCodeLowerCaseAscii(byte[] array) -
hashCodeLowerCaseAscii
-
hashCodeUpperCaseAscii
public static int hashCodeUpperCaseAscii(byte[] array, int offset, int size) -
hashCodeUpperCaseAscii
public static int hashCodeUpperCaseAscii(byte[] array) -
hashCodeUpperCaseAscii
-
encodeUtf8
-
putUtf8
-
wrapUtf8
-
decodeUtf8
- Throws:
MalformedDataException
-
decodeUtf8
- Throws:
MalformedDataException
-
decodeUtf8
- Throws:
MalformedDataException
-
asUtf8
- Throws:
MalformedDataException
-
encodeInt
public static int encodeInt(byte[] array, int pos, int value) -
encodePositiveInt
public static int encodePositiveInt(byte[] array, int pos, int value) -
encodeLong
public static int encodeLong(byte[] array, int pos, long value) -
encodePositiveLong
public static int encodePositiveLong(byte[] array, int pos, long value) -
putInt
-
putPositiveInt
-
putLong
-
putPositiveLong
-
wrapInt
-
wrapLong
-
decodeInt
- Throws:
MalformedDataException
-
decodeLong
- Throws:
MalformedDataException
-
decodePositiveInt
- Throws:
MalformedDataException
-
decodePositiveLong
- Throws:
MalformedDataException
-