Class ByteUtils

java.lang.Object
com.luna.common.text.ByteUtils

public class ByteUtils extends Object
  • Constructor Details

    • ByteUtils

      public ByteUtils()
  • Method Details

    • subBytes

      public static byte[] subBytes(byte[] bs, int startIndex, int length)
      字节截取
      Parameters:
      bs - 原始数据
      startIndex - 开始
      length - 长度
      Returns:
    • copy

      public static byte[] copy(byte[] bs)
      字节拷贝 以来native方法
      Parameters:
      bs - 原始数据
      Returns:
    • concat

      public static byte[] concat(byte[] bytes1, byte[] bytes2)
    • subToSmallBytes

      public static List<byte[]> subToSmallBytes(byte[] bs, int minLength, int maxLength)
    • subToSmallBytes

      public static List<byte[]> subToSmallBytes(File file, int subLen) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • subToSmallBytes

      public static List<byte[]> subToSmallBytes(InputStream inputStream, int subLen)
    • inputStream2ByteArray

      public static byte[] inputStream2ByteArray(String filePath)
    • inputStream2ByteArray

      public static byte[] inputStream2ByteArray(File file)