类 ByteUtils

java.lang.Object
cn.zhxu.toys.util.ByteUtils

public class ByteUtils extends Object
从以下版本开始:
0.4.6
作者:
Troy
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static String
    bcd(byte[] src, int from, int to)
     
    static int
    countOf(byte[] arr, byte target)
     
    static boolean
    equals(byte[] arr1, byte[] arr2)
     
    static byte[]
    hexToBytes(String hexContent)
     
    static int
    indexOf(byte[] arr, byte target, int from, int to)
    寻找目标字节在字节数组中的下标
    static byte[]
    join(byte[]... arrs)
     
    static byte[]
    join(byte hyphen, byte[]... arrs)
     
    static void
    main(String[] args)
     
    static byte[][]
    split(byte[] arr, byte separator)
     
    static byte[]
    subArray(byte[] arr, int from)
     
    static byte[]
    subArray(byte[] arr, int from, int to)
     
    static byte[]
    trim(byte[] src, byte empty)
     
    static byte[]
    trim(byte[] src, byte empty, int from, int to)
     
    static int
    unsigned(byte value)
     
    static int
    xor(byte[] bytes)
    异或值,返回

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ByteUtils

      public ByteUtils()
  • 方法详细资料

    • unsigned

      public static int unsigned(byte value)
    • equals

      public static boolean equals(byte[] arr1, byte[] arr2)
    • split

      public static byte[][] split(byte[] arr, byte separator)
    • indexOf

      public static int indexOf(byte[] arr, byte target, int from, int to)
      寻找目标字节在字节数组中的下标
      参数:
      arr - 数组
      target - 目标字节
      from - 检索开始下标(包含)
      to - 检索结束下标(不包含)
      返回:
      找不到则返回-1
    • countOf

      public static int countOf(byte[] arr, byte target)
    • subArray

      public static byte[] subArray(byte[] arr, int from)
    • subArray

      public static byte[] subArray(byte[] arr, int from, int to)
    • join

      public static byte[] join(byte hyphen, byte[]... arrs)
    • join

      public static byte[] join(byte[]... arrs)
    • trim

      public static byte[] trim(byte[] src, byte empty)
    • trim

      public static byte[] trim(byte[] src, byte empty, int from, int to)
    • bcd

      public static String bcd(byte[] src, int from, int to)
    • xor

      public static int xor(byte[] bytes)
      异或值,返回
      参数:
      bytes - 数组
      返回:
      异或值
    • hexToBytes

      public static byte[] hexToBytes(String hexContent)
    • main

      public static void main(String[] args)