@Test public void testEncodeLong() throws ParseException { ByteBuf buf = ByteBuf.wrapForWriting(new byte[20]); encodeLongTest(buf, Long.MAX_VALUE); encodeLongTest(buf, Long.MIN_VALUE); long value = RANDOM.nextLong(); byte[] bytes = String.valueOf(value).getBytes(); Arrays.fill(bytes, (byte) 0); buf = ByteBuf.wrapForWriting(bytes); encodeLongTest(buf, value); }
public static int encodeLong(byte[] array, int pos, long value) { if (value >= 0) { return encodePositiveLong(array, pos, value); } else { return encodeNegativeLong(array, pos, value); } }
ByteBufStrings { public static int encodeLong(byte[] array, int pos, long value) { if (value >= 0) { return encodePositiveLong(array, pos, value); } else { return encodeNegativeLong(array, pos, value); } } }
ByteBufStrings { public static int encodeLong(byte[] array, int pos, long value) { if (value >= 0) { return encodePositiveLong(array, pos, value); } else { return encodeNegativeLong(array, pos, value); } }  }
ByteBufStrings { public static int encodeLong(byte[] array, int pos, long value) { if (value >= 0) { return encodePositiveLong(array, pos, value); } else { return encodeNegativeLong(array, pos, value); } }  static void encodeAscii(byte[] array, int pos, String string); static byte[] encodeAscii(String string); static void putAscii(ByteBuf buf, String string); static ByteBuf wrapAscii(String string); static String decodeAscii(byte[] array, int pos, int len, char[] tmpBuffer); static String decodeAscii(byte[] array, int pos, int len); static String asAscii(ByteBuf buf); static String decodeAscii(byte[] array); static void toLowerCaseAscii(byte[] bytes, int pos, int len); static void toLowerCaseAscii(byte[] bytes); static void toLowerCaseAscii(ByteBuf buf); static void toUpperCaseAscii(byte[] bytes, int pos, int len); static void toUpperCaseAscii(byte[] bytes); static void toUpperCaseAscii(ByteBuf buf); static boolean equalsLowerCaseAscii(byte[] lowerCasePattern, byte[] array, int offset, int size); static boolean equalsUpperCaseAscii(byte[] upperCasePattern, byte[] array, int offset, int size); static int hashCode(byte[] array, int offset, int size); static int hashCode(byte[] array); static int hashCode(ByteBuf buf); static int hashCodeLowerCaseAscii(byte[] array, int offset, int size); static int hashCodeLowerCaseAscii(byte[] array); static int hashCodeLowerCaseAscii(ByteBuf buf); static int hashCodeUpperCaseAscii(byte[] array, int offset, int size); static int hashCodeUpperCaseAscii(byte[] array); static int hashCodeUpperCaseAscii(ByteBuf buf); static int encodeUtf8(byte[] array, int pos, String string); static int encodeUtf8(byte[] array, int pos, char c); static void putUtf8(ByteBuf buf, String string); static void putUtf8(ByteBuf buf, char c); static ByteBuf wrapUtf8(String string); static int decodeUtf8(byte[] array, int pos, int len, char[] buffer, int to); static String decodeUtf8(byte[] array, int pos, int len, char[] tmpBuffer); static String decodeUtf8(byte[] array, int pos, int len); static String decodeUtf8(ByteBuf buf, char[] tmpBuffer); static String decodeUtf8(ByteBuf buf); static String decodeUtf8(byte[] array); static String asUtf8(ByteBuf buf); static int encodeInt(byte[] array, int pos, int value); static int encodePositiveInt(byte[] array, int pos, int value); static int encodeLong(byte[] array, int pos, long value); static int encodePositiveLong(byte[] array, int pos, long value); static void putInt(ByteBuf buf, int value); static void putPositiveInt(ByteBuf buf, int value); static void putLong(ByteBuf buf, long value); static void putPositiveLong(ByteBuf buf, long value); static ByteBuf wrapInt(int value); static ByteBuf wrapLong(long value); static int decodeInt(byte[] array, int pos, int len); static long decodeLong(byte[] array, int pos, int len); static int decodePositiveInt(byte[] array, int pos, int len); static long decodePositiveLong(byte[] array, int pos, int len); }
ByteBufStrings { public static int encodeLong(byte[] array, int pos, long value) { if (value >= 0) { return encodePositiveLong(array, pos, value); } else { return encodeNegativeLong(array, pos, value); } }  static void encodeAscii(byte[] array, int pos, String string); static byte[] encodeAscii(String string); static void putAscii(ByteBuf buf, String string); static ByteBuf wrapAscii(String string); static String decodeAscii(byte[] array, int pos, int len, char[] tmpBuffer); static String decodeAscii(byte[] array, int pos, int len); static String asAscii(ByteBuf buf); static String decodeAscii(byte[] array); static void toLowerCaseAscii(byte[] bytes, int pos, int len); static void toLowerCaseAscii(byte[] bytes); static void toLowerCaseAscii(ByteBuf buf); static void toUpperCaseAscii(byte[] bytes, int pos, int len); static void toUpperCaseAscii(byte[] bytes); static void toUpperCaseAscii(ByteBuf buf); static boolean equalsLowerCaseAscii(byte[] lowerCasePattern, byte[] array, int offset, int size); static boolean equalsUpperCaseAscii(byte[] upperCasePattern, byte[] array, int offset, int size); static int hashCode(byte[] array, int offset, int size); static int hashCode(byte[] array); static int hashCode(ByteBuf buf); static int hashCodeLowerCaseAscii(byte[] array, int offset, int size); static int hashCodeLowerCaseAscii(byte[] array); static int hashCodeLowerCaseAscii(ByteBuf buf); static int hashCodeUpperCaseAscii(byte[] array, int offset, int size); static int hashCodeUpperCaseAscii(byte[] array); static int hashCodeUpperCaseAscii(ByteBuf buf); static int encodeUtf8(byte[] array, int pos, String string); static int encodeUtf8(byte[] array, int pos, char c); static void putUtf8(ByteBuf buf, String string); static void putUtf8(ByteBuf buf, char c); static ByteBuf wrapUtf8(String string); static int decodeUtf8(byte[] array, int pos, int len, char[] buffer, int to); static String decodeUtf8(byte[] array, int pos, int len, char[] tmpBuffer); static String decodeUtf8(byte[] array, int pos, int len); static String decodeUtf8(ByteBuf buf, char[] tmpBuffer); static String decodeUtf8(ByteBuf buf); static String decodeUtf8(byte[] array); static String asUtf8(ByteBuf buf); static int encodeInt(byte[] array, int pos, int value); static int encodePositiveInt(byte[] array, int pos, int value); static int encodeLong(byte[] array, int pos, long value); static int encodePositiveLong(byte[] array, int pos, long value); static void putInt(ByteBuf buf, int value); static void putPositiveInt(ByteBuf buf, int value); static void putLong(ByteBuf buf, long value); static void putPositiveLong(ByteBuf buf, long value); static ByteBuf wrapInt(int value); static ByteBuf wrapLong(long value); static int decodeInt(byte[] array, int pos, int len); static long decodeLong(byte[] array, int pos, int len); static int decodePositiveInt(byte[] array, int pos, int len); static long decodePositiveLong(byte[] array, int pos, int len); static final ParseException READ_PAST_LIMIT; static final ParseException READ_PAST_ARRAY_LENGTH; static final byte CR; static final byte LF; static final byte SP; static final byte HT; }