Class ByteBufStrings

java.lang.Object
io.activej.bytebuf.ByteBufStrings

public final class ByteBufStrings extends Object
This class contains various fast string utilities for ByteBufs and byte arrays
  • Field Details

  • Constructor Details

    • ByteBufStrings

      public ByteBufStrings()
  • Method Details

    • encodeAscii

      public static int encodeAscii(byte[] array, int pos, String string)
    • encodeAscii

      public static byte[] encodeAscii(String string)
    • putAscii

      public static void putAscii(ByteBuf buf, String string)
    • wrapAscii

      public static ByteBuf wrapAscii(String string)
    • decodeAscii

      public static String decodeAscii(byte[] array, int pos, int len, char[] tmpBuffer)
    • decodeAscii

      public static String decodeAscii(byte[] array, int pos, int len)
    • asAscii

      public static String asAscii(ByteBuf buf)
    • decodeAscii

      public static String decodeAscii(byte[] array)
    • toLowerCaseAscii

      public static void toLowerCaseAscii(byte[] bytes, int pos, int len)
    • toLowerCaseAscii

      public static void toLowerCaseAscii(byte[] bytes)
    • toLowerCaseAscii

      public static void toLowerCaseAscii(ByteBuf buf)
    • toUpperCaseAscii

      public static void toUpperCaseAscii(byte[] bytes, int pos, int len)
    • toUpperCaseAscii

      public static void toUpperCaseAscii(byte[] bytes)
    • toUpperCaseAscii

      public static void toUpperCaseAscii(ByteBuf buf)
    • 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

      public static int hashCode(ByteBuf buf)
    • hashCodeLowerCaseAscii

      public static int hashCodeLowerCaseAscii(byte[] array, int offset, int size)
    • hashCodeLowerCaseAscii

      public static int hashCodeLowerCaseAscii(byte[] array)
    • hashCodeLowerCaseAscii

      public static int hashCodeLowerCaseAscii(ByteBuf buf)
    • hashCodeUpperCaseAscii

      public static int hashCodeUpperCaseAscii(byte[] array, int offset, int size)
    • hashCodeUpperCaseAscii

      public static int hashCodeUpperCaseAscii(byte[] array)
    • hashCodeUpperCaseAscii

      public static int hashCodeUpperCaseAscii(ByteBuf buf)
    • encodeUtf8

      public static int encodeUtf8(byte[] array, int offset, String string)
    • putUtf8

      public static void putUtf8(ByteBuf buf, String string)
    • wrapUtf8

      public static ByteBuf wrapUtf8(String string)
    • decodeUtf8

      public static String decodeUtf8(byte[] array, int pos, int len) throws MalformedDataException
      Throws:
      MalformedDataException
    • decodeUtf8

      public static String decodeUtf8(ByteBuf buf) throws MalformedDataException
      Throws:
      MalformedDataException
    • decodeUtf8

      public static String decodeUtf8(byte[] array) throws MalformedDataException
      Throws:
      MalformedDataException
    • asUtf8

      public static String asUtf8(ByteBuf buf) throws MalformedDataException
      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

      public static void putInt(ByteBuf buf, int value)
    • putPositiveInt

      public static void putPositiveInt(ByteBuf buf, int value)
    • putLong

      public static void putLong(ByteBuf buf, long value)
    • putPositiveLong

      public static void putPositiveLong(ByteBuf buf, long value)
    • wrapInt

      public static ByteBuf wrapInt(int value)
    • wrapLong

      public static ByteBuf wrapLong(long value)
    • decodeInt

      public static int decodeInt(byte[] array, int pos, int len) throws MalformedDataException
      Throws:
      MalformedDataException
    • decodeLong

      public static long decodeLong(byte[] array, int pos, int len) throws MalformedDataException
      Throws:
      MalformedDataException
    • decodePositiveInt

      public static int decodePositiveInt(byte[] array, int pos, int len) throws MalformedDataException
      Throws:
      MalformedDataException
    • decodePositiveLong

      public static long decodePositiveLong(byte[] array, int pos, int len) throws MalformedDataException
      Throws:
      MalformedDataException