java.lang.Object
org.apache.kerby.kerberos.kerb.crypto.util.BytesUtil

public class BytesUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    bytes2int(byte[] bytes, boolean bigEndian)
     
    static int
    bytes2int(byte[] bytes, int offset, boolean bigEndian)
     
    static long
    bytes2long(byte[] bytes, boolean bigEndian)
     
    static long
    bytes2long(byte[] bytes, int offset, boolean bigEndian)
     
    static short
    bytes2short(byte[] bytes, boolean bigEndian)
     
    static short
    bytes2short(byte[] bytes, int offset, boolean bigEndian)
     
    static byte[]
    duplicate(byte[] bytes)
     
    static byte[]
    duplicate(byte[] bytes, int offset, int len)
     
    static byte[]
    int2bytes(int val, boolean bigEndian)
     
    static void
    int2bytes(int val, byte[] bytes, int offset, boolean bigEndian)
     
    static byte[]
    long2bytes(long val, boolean bigEndian)
     
    static void
    long2bytes(long val, byte[] bytes, int offset, boolean bigEndian)
     
    static byte[]
    padding(byte[] data, int block)
     
    static byte[]
    short2bytes(int val, boolean bigEndian)
     
    static void
    short2bytes(int val, byte[] bytes, int offset, boolean bigEndian)
     
    static void
    xor(byte[] a, byte[] b, byte[] output)
     
    static void
    xor(byte[] input, int offset, byte[] output)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BytesUtil

      public BytesUtil()
  • Method Details

    • bytes2short

      public static short bytes2short(byte[] bytes, int offset, boolean bigEndian)
    • bytes2short

      public static short bytes2short(byte[] bytes, boolean bigEndian)
    • short2bytes

      public static byte[] short2bytes(int val, boolean bigEndian)
    • short2bytes

      public static void short2bytes(int val, byte[] bytes, int offset, boolean bigEndian)
    • bytes2int

      public static int bytes2int(byte[] bytes, boolean bigEndian)
    • bytes2int

      public static int bytes2int(byte[] bytes, int offset, boolean bigEndian)
    • int2bytes

      public static byte[] int2bytes(int val, boolean bigEndian)
    • int2bytes

      public static void int2bytes(int val, byte[] bytes, int offset, boolean bigEndian)
    • long2bytes

      public static byte[] long2bytes(long val, boolean bigEndian)
    • long2bytes

      public static void long2bytes(long val, byte[] bytes, int offset, boolean bigEndian)
    • bytes2long

      public static long bytes2long(byte[] bytes, boolean bigEndian)
    • bytes2long

      public static long bytes2long(byte[] bytes, int offset, boolean bigEndian)
    • padding

      public static byte[] padding(byte[] data, int block)
    • duplicate

      public static byte[] duplicate(byte[] bytes)
    • duplicate

      public static byte[] duplicate(byte[] bytes, int offset, int len)
    • xor

      public static void xor(byte[] input, int offset, byte[] output)
    • xor

      public static void xor(byte[] a, byte[] b, byte[] output)