Class ByteArrayUtil

java.lang.Object
com.mckoi.util.ByteArrayUtil

public class ByteArrayUtil extends Object
Static utilities for byte arrays.
Author:
Tobias Downer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final char
    getChar(byte[] arr, int offset)
    Returns the chart at the given offset of the byte array.
    static final int
    getInt(byte[] arr, int offset)
    Returns the int at the given offset of the byte array.
    static final long
    getLong(byte[] arr, int offset)
    Returns the long at the given offset of the byte array.
    static final short
    getShort(byte[] arr, int offset)
    Returns the short at the given offset of the byte array.
    static final void
    setChar(char value, byte[] arr, int offset)
    Sets the short at the given offset of the byte array.
    static final void
    setInt(int value, byte[] arr, int offset)
    Sets the int at the given offset of the byte array.
    static final void
    setLong(long value, byte[] arr, int offset)
    Sets the long at the given offset of the byte array.
    static final void
    setShort(short value, byte[] arr, int offset)
    Sets the short at the given offset of the byte array.

    Methods inherited from class java.lang.Object

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

    • ByteArrayUtil

      public ByteArrayUtil()
  • Method Details

    • getChar

      public static final char getChar(byte[] arr, int offset)
      Returns the chart at the given offset of the byte array.
    • setChar

      public static final void setChar(char value, byte[] arr, int offset)
      Sets the short at the given offset of the byte array.
    • getShort

      public static final short getShort(byte[] arr, int offset)
      Returns the short at the given offset of the byte array.
    • setShort

      public static final void setShort(short value, byte[] arr, int offset)
      Sets the short at the given offset of the byte array.
    • getInt

      public static final int getInt(byte[] arr, int offset)
      Returns the int at the given offset of the byte array.
    • setInt

      public static final void setInt(int value, byte[] arr, int offset)
      Sets the int at the given offset of the byte array.
    • getLong

      public static final long getLong(byte[] arr, int offset)
      Returns the long at the given offset of the byte array.
    • setLong

      public static final void setLong(long value, byte[] arr, int offset)
      Sets the long at the given offset of the byte array.