public class

ByteArrayUtils

extends Object
java.lang.Object
   ↳ net.schmizz.sshj.common.ByteArrayUtils

Class Overview

Utility functions for byte arrays.

Summary

Fields
static final char[] digits
Public Constructors
ByteArrayUtils()
Public Methods
static boolean equals(byte[] a1, int a1Offset, byte[] a2, int a2Offset, int length)
Check whether some part or whole of two byte arrays is equal, for length bytes starting at some offset.
static String printHex(byte[] array, int offset, int len)
Get a hexadecimal representation of a byte array starting at offset index for len bytes, with each octet separated by a space.
static String toHex(byte[] array)
Get the hexadecimal representation of a byte array.
static String toHex(byte[] array, int offset, int len)
Get the hexadecimal representation of a byte array starting at offset index for len bytes.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

static final char[] digits

Public Constructors

public ByteArrayUtils ()

Public Methods

public static boolean equals (byte[] a1, int a1Offset, byte[] a2, int a2Offset, int length)

Check whether some part or whole of two byte arrays is equal, for length bytes starting at some offset.

Parameters
a1
a1Offset
a2
a2Offset
length
Returns
  • true or false

public static String printHex (byte[] array, int offset, int len)

Get a hexadecimal representation of a byte array starting at offset index for len bytes, with each octet separated by a space.

Parameters
array
offset
len
Returns
  • hex string, each octet delimited by a space

public static String toHex (byte[] array)

Get the hexadecimal representation of a byte array.

Parameters
array
Returns
  • hex string

public static String toHex (byte[] array, int offset, int len)

Get the hexadecimal representation of a byte array starting at offset index for len bytes.

Parameters
array
offset
len
Returns
  • hex string