Class TlsUtils

java.lang.Object
org.red5.io.utils.TlsUtils

public class TlsUtils extends Object
Some helper functions for the TLS API.
Author:
mondain
  • Field Details

    • EMPTY_BYTES

      public static final byte[] EMPTY_BYTES
      Constant EMPTY_BYTES
    • EMPTY_SHORTS

      public static final short[] EMPTY_SHORTS
      Constant EMPTY_SHORTS
    • EMPTY_INTS

      public static final int[] EMPTY_INTS
      Constant EMPTY_INTS
    • EMPTY_LONGS

      public static final long[] EMPTY_LONGS
      Constant EMPTY_LONGS
    • EMPTY_STRINGS

      public static final String[] EMPTY_STRINGS
      Constant EMPTY_STRINGS
  • Constructor Details

    • TlsUtils

      public TlsUtils()
  • Method Details

    • isValidUint8

      public static boolean isValidUint8(short i)

      isValidUint8.

      Parameters:
      i - a short
      Returns:
      a boolean
    • isValidUint8

      public static boolean isValidUint8(int i)

      isValidUint8.

      Parameters:
      i - a int
      Returns:
      a boolean
    • isValidUint8

      public static boolean isValidUint8(long i)

      isValidUint8.

      Parameters:
      i - a long
      Returns:
      a boolean
    • isValidUint16

      public static boolean isValidUint16(int i)

      isValidUint16.

      Parameters:
      i - a int
      Returns:
      a boolean
    • isValidUint16

      public static boolean isValidUint16(long i)

      isValidUint16.

      Parameters:
      i - a long
      Returns:
      a boolean
    • isValidUint24

      public static boolean isValidUint24(int i)

      isValidUint24.

      Parameters:
      i - a int
      Returns:
      a boolean
    • isValidUint24

      public static boolean isValidUint24(long i)

      isValidUint24.

      Parameters:
      i - a long
      Returns:
      a boolean
    • isValidUint32

      public static boolean isValidUint32(long i)

      isValidUint32.

      Parameters:
      i - a long
      Returns:
      a boolean
    • isValidUint48

      public static boolean isValidUint48(long i)

      isValidUint48.

      Parameters:
      i - a long
      Returns:
      a boolean
    • isValidUint64

      public static boolean isValidUint64(long i)

      isValidUint64.

      Parameters:
      i - a long
      Returns:
      a boolean
    • writeUint8

      public static void writeUint8(short i, OutputStream output) throws IOException

      writeUint8.

      Parameters:
      i - a short
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint8

      public static void writeUint8(int i, OutputStream output) throws IOException

      writeUint8.

      Parameters:
      i - a int
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint8

      public static void writeUint8(short i, byte[] buf, int offset)

      writeUint8.

      Parameters:
      i - a short
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeUint8

      public static void writeUint8(int i, byte[] buf, int offset)

      writeUint8.

      Parameters:
      i - a int
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeUint16

      public static void writeUint16(int i, OutputStream output) throws IOException

      writeUint16.

      Parameters:
      i - a int
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint16

      public static void writeUint16(int i, byte[] buf, int offset)

      writeUint16.

      Parameters:
      i - a int
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeUint24

      public static void writeUint24(int i, OutputStream output) throws IOException

      writeUint24.

      Parameters:
      i - a int
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint24

      public static void writeUint24(int i, byte[] buf, int offset)

      writeUint24.

      Parameters:
      i - a int
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeUint32

      public static void writeUint32(long i, OutputStream output) throws IOException

      writeUint32.

      Parameters:
      i - a long
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint32

      public static void writeUint32(long i, byte[] buf, int offset)

      writeUint32.

      Parameters:
      i - a long
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeUint48

      public static void writeUint48(long i, OutputStream output) throws IOException

      writeUint48.

      Parameters:
      i - a long
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint48

      public static void writeUint48(long i, byte[] buf, int offset)

      writeUint48.

      Parameters:
      i - a long
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeUint64

      public static void writeUint64(long i, OutputStream output) throws IOException

      writeUint64.

      Parameters:
      i - a long
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint64

      public static void writeUint64(long i, byte[] buf, int offset)

      writeUint64.

      Parameters:
      i - a long
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • writeOpaque8

      public static void writeOpaque8(byte[] buf, OutputStream output) throws IOException

      writeOpaque8.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeOpaque8

      public static void writeOpaque8(byte[] data, byte[] buf, int off) throws IOException

      writeOpaque8.

      Parameters:
      data - an array of
      invalid reference
      byte
      objects
      buf - an array of
      invalid reference
      byte
      objects
      off - a int
      Throws:
      IOException - if any.
    • writeOpaque16

      public static void writeOpaque16(byte[] buf, OutputStream output) throws IOException

      writeOpaque16.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeOpaque16

      public static void writeOpaque16(byte[] data, byte[] buf, int off) throws IOException

      writeOpaque16.

      Parameters:
      data - an array of
      invalid reference
      byte
      objects
      buf - an array of
      invalid reference
      byte
      objects
      off - a int
      Throws:
      IOException - if any.
    • writeOpaque24

      public static void writeOpaque24(byte[] buf, OutputStream output) throws IOException

      writeOpaque24.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeOpaque24

      public static void writeOpaque24(byte[] data, byte[] buf, int off) throws IOException

      writeOpaque24.

      Parameters:
      data - an array of
      invalid reference
      byte
      objects
      buf - an array of
      invalid reference
      byte
      objects
      off - a int
      Throws:
      IOException - if any.
    • writeUint8Array

      public static void writeUint8Array(short[] uints, OutputStream output) throws IOException

      writeUint8Array.

      Parameters:
      uints - an array of
      invalid reference
      short
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint8Array

      public static void writeUint8Array(short[] uints, byte[] buf, int offset) throws IOException

      writeUint8Array.

      Parameters:
      uints - an array of
      invalid reference
      short
      objects
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Throws:
      IOException - if any.
    • writeUint8ArrayWithUint8Length

      public static void writeUint8ArrayWithUint8Length(short[] uints, OutputStream output) throws IOException

      writeUint8ArrayWithUint8Length.

      Parameters:
      uints - an array of
      invalid reference
      short
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint8ArrayWithUint8Length

      public static void writeUint8ArrayWithUint8Length(short[] uints, byte[] buf, int offset) throws IOException

      writeUint8ArrayWithUint8Length.

      Parameters:
      uints - an array of
      invalid reference
      short
      objects
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Throws:
      IOException - if any.
    • writeUint16Array

      public static void writeUint16Array(int[] uints, OutputStream output) throws IOException

      writeUint16Array.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint16Array

      public static void writeUint16Array(int[] uints, byte[] buf, int offset) throws IOException

      writeUint16Array.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Throws:
      IOException - if any.
    • writeUint16ArrayWithUint8Length

      public static void writeUint16ArrayWithUint8Length(int[] uints, byte[] buf, int offset) throws IOException

      writeUint16ArrayWithUint8Length.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Throws:
      IOException - if any.
    • writeUint16ArrayWithUint16Length

      public static void writeUint16ArrayWithUint16Length(int[] uints, OutputStream output) throws IOException

      writeUint16ArrayWithUint16Length.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      output - a OutputStream object
      Throws:
      IOException - if any.
    • writeUint16ArrayWithUint16Length

      public static void writeUint16ArrayWithUint16Length(int[] uints, byte[] buf, int offset) throws IOException

      writeUint16ArrayWithUint16Length.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Throws:
      IOException - if any.
    • decodeOpaque8

      public static byte[] decodeOpaque8(byte[] buf) throws IOException

      decodeOpaque8.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • decodeOpaque8

      public static byte[] decodeOpaque8(byte[] buf, int minLength) throws IOException

      decodeOpaque8.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      minLength - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • decodeOpaque16

      public static byte[] decodeOpaque16(byte[] buf) throws IOException

      decodeOpaque16.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • decodeOpaque16

      public static byte[] decodeOpaque16(byte[] buf, int minLength) throws IOException

      decodeOpaque16.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      minLength - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • decodeUint8

      public static short decodeUint8(byte[] buf) throws IOException

      decodeUint8.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      a short
      Throws:
      IOException - if any.
    • decodeUint8ArrayWithUint8Length

      public static short[] decodeUint8ArrayWithUint8Length(byte[] buf) throws IOException

      decodeUint8ArrayWithUint8Length.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      short
      objects
      Throws:
      IOException - if any.
    • decodeUint16

      public static int decodeUint16(byte[] buf) throws IOException

      decodeUint16.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      a int
      Throws:
      IOException - if any.
    • decodeUint16ArrayWithUint8Length

      public static int[] decodeUint16ArrayWithUint8Length(byte[] buf) throws IOException

      decodeUint16ArrayWithUint8Length.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      int
      objects
      Throws:
      IOException - if any.
    • decodeUint32

      public static long decodeUint32(byte[] buf) throws IOException

      decodeUint32.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      a long
      Throws:
      IOException - if any.
    • encodeOpaque8

      public static byte[] encodeOpaque8(byte[] buf) throws IOException

      encodeOpaque8.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeOpaque16

      public static byte[] encodeOpaque16(byte[] buf) throws IOException

      encodeOpaque16.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeOpaque24

      public static byte[] encodeOpaque24(byte[] buf) throws IOException

      encodeOpaque24.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint8

      public static byte[] encodeUint8(short uint) throws IOException

      encodeUint8.

      Parameters:
      uint - a short
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint8ArrayWithUint8Length

      public static byte[] encodeUint8ArrayWithUint8Length(short[] uints) throws IOException

      encodeUint8ArrayWithUint8Length.

      Parameters:
      uints - an array of
      invalid reference
      short
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint16

      public static byte[] encodeUint16(int uint) throws IOException

      encodeUint16.

      Parameters:
      uint - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint16ArrayWithUint8Length

      public static byte[] encodeUint16ArrayWithUint8Length(int[] uints) throws IOException

      encodeUint16ArrayWithUint8Length.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint16ArrayWithUint16Length

      public static byte[] encodeUint16ArrayWithUint16Length(int[] uints) throws IOException

      encodeUint16ArrayWithUint16Length.

      Parameters:
      uints - an array of
      invalid reference
      int
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint24

      public static byte[] encodeUint24(int uint) throws IOException

      encodeUint24.

      Parameters:
      uint - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • encodeUint32

      public static byte[] encodeUint32(long uint) throws IOException

      encodeUint32.

      Parameters:
      uint - a long
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readInt32

      public static int readInt32(byte[] buf, int offset)

      readInt32.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Returns:
      a int
    • readUint8

      public static short readUint8(InputStream input) throws IOException

      readUint8.

      Parameters:
      input - a InputStream object
      Returns:
      a short
      Throws:
      IOException - if any.
    • readUint8

      public static short readUint8(byte[] buf, int offset)

      readUint8.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Returns:
      a short
    • readUint16

      public static int readUint16(InputStream input) throws IOException

      readUint16.

      Parameters:
      input - a InputStream object
      Returns:
      a int
      Throws:
      IOException - if any.
    • readUint16

      public static int readUint16(byte[] buf, int offset)

      readUint16.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Returns:
      a int
    • readUint24

      public static int readUint24(InputStream input) throws IOException

      readUint24.

      Parameters:
      input - a InputStream object
      Returns:
      a int
      Throws:
      IOException - if any.
    • readUint24

      public static int readUint24(byte[] buf, int offset)

      readUint24.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Returns:
      a int
    • readUint32

      public static long readUint32(InputStream input) throws IOException

      readUint32.

      Parameters:
      input - a InputStream object
      Returns:
      a long
      Throws:
      IOException - if any.
    • readUint32

      public static long readUint32(byte[] buf, int offset)

      readUint32.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Returns:
      a long
    • readUint48

      public static long readUint48(InputStream input) throws IOException

      readUint48.

      Parameters:
      input - a InputStream object
      Returns:
      a long
      Throws:
      IOException - if any.
    • readUint48

      public static long readUint48(byte[] buf, int offset)

      readUint48.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
      Returns:
      a long
    • readAllOrNothing

      public static byte[] readAllOrNothing(int length, InputStream input) throws IOException

      readAllOrNothing.

      Parameters:
      length - a int
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readFully

      public static byte[] readFully(int length, InputStream input) throws IOException

      readFully.

      Parameters:
      length - a int
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readFully

      public static void readFully(byte[] buf, InputStream input) throws IOException

      readFully.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      input - a InputStream object
      Throws:
      IOException - if any.
    • readOpaque8

      public static byte[] readOpaque8(InputStream input) throws IOException

      readOpaque8.

      Parameters:
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readOpaque8

      public static byte[] readOpaque8(InputStream input, int minLength) throws IOException

      readOpaque8.

      Parameters:
      input - a InputStream object
      minLength - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readOpaque8

      public static byte[] readOpaque8(InputStream input, int minLength, int maxLength) throws IOException

      readOpaque8.

      Parameters:
      input - a InputStream object
      minLength - a int
      maxLength - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readOpaque16

      public static byte[] readOpaque16(InputStream input) throws IOException

      readOpaque16.

      Parameters:
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readOpaque16

      public static byte[] readOpaque16(InputStream input, int minLength) throws IOException

      readOpaque16.

      Parameters:
      input - a InputStream object
      minLength - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readOpaque24

      public static byte[] readOpaque24(InputStream input) throws IOException

      readOpaque24.

      Parameters:
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readOpaque24

      public static byte[] readOpaque24(InputStream input, int minLength) throws IOException

      readOpaque24.

      Parameters:
      input - a InputStream object
      minLength - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • readUint8Array

      public static short[] readUint8Array(int count, InputStream input) throws IOException

      readUint8Array.

      Parameters:
      count - a int
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      short
      objects
      Throws:
      IOException - if any.
    • readUint8ArrayWithUint8Length

      public static short[] readUint8ArrayWithUint8Length(InputStream input, int minLength) throws IOException

      readUint8ArrayWithUint8Length.

      Parameters:
      input - a InputStream object
      minLength - a int
      Returns:
      an array of
      invalid reference
      short
      objects
      Throws:
      IOException - if any.
    • readUint16Array

      public static int[] readUint16Array(int count, InputStream input) throws IOException

      readUint16Array.

      Parameters:
      count - a int
      input - a InputStream object
      Returns:
      an array of
      invalid reference
      int
      objects
      Throws:
      IOException - if any.
    • readASN1Object

      public static org.bouncycastle.asn1.ASN1Primitive readASN1Object(byte[] encoding) throws IOException

      readASN1Object.

      Parameters:
      encoding - an array of
      invalid reference
      byte
      objects
      Returns:
      a ASN1Primitive object
      Throws:
      IOException - if any.
    • readDERObject

      public static org.bouncycastle.asn1.ASN1Primitive readDERObject(byte[] encoding) throws IOException
      Deprecated.

      readDERObject.

      Parameters:
      encoding - an array of
      invalid reference
      byte
      objects
      Returns:
      a ASN1Primitive object
      Throws:
      IOException - if any.
    • requireDEREncoding

      public static void requireDEREncoding(org.bouncycastle.asn1.ASN1Object asn1, byte[] encoding) throws IOException

      requireDEREncoding.

      Parameters:
      asn1 - a ASN1Object object
      encoding - an array of
      invalid reference
      byte
      objects
      Throws:
      IOException - if any.
    • writeGMTUnixTime

      public static void writeGMTUnixTime(byte[] buf, int offset)

      writeGMTUnixTime.

      Parameters:
      buf - an array of
      invalid reference
      byte
      objects
      offset - a int
    • addToSet

      public static boolean addToSet(Vector s, int i)

      addToSet.

      Parameters:
      s - a Vector object
      i - a int
      Returns:
      a boolean
    • getExtensionData

      public static byte[] getExtensionData(Hashtable extensions, Integer extensionType)

      getExtensionData.

      Parameters:
      extensions - a Hashtable object
      extensionType - a Integer object
      Returns:
      an array of
      invalid reference
      byte
      objects
    • hasExpectedEmptyExtensionData

      public static boolean hasExpectedEmptyExtensionData(Hashtable extensions, Integer extensionType, short alertDescription) throws IOException

      hasExpectedEmptyExtensionData.

      Parameters:
      extensions - a Hashtable object
      extensionType - a Integer object
      alertDescription - a short
      Returns:
      a boolean
      Throws:
      IOException - if any.
    • isNullOrContainsNull

      public static boolean isNullOrContainsNull(Object[] array)

      isNullOrContainsNull.

      Parameters:
      array - an array of Object objects
      Returns:
      a boolean
    • isNullOrEmpty

      public static boolean isNullOrEmpty(byte[] array)

      isNullOrEmpty.

      Parameters:
      array - an array of
      invalid reference
      byte
      objects
      Returns:
      a boolean
    • isNullOrEmpty

      public static boolean isNullOrEmpty(short[] array)

      isNullOrEmpty.

      Parameters:
      array - an array of
      invalid reference
      short
      objects
      Returns:
      a boolean
    • isNullOrEmpty

      public static boolean isNullOrEmpty(int[] array)

      isNullOrEmpty.

      Parameters:
      array - an array of
      invalid reference
      int
      objects
      Returns:
      a boolean
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Object[] array)

      isNullOrEmpty.

      Parameters:
      array - an array of Object objects
      Returns:
      a boolean
    • isNullOrEmpty

      public static boolean isNullOrEmpty(String s)

      isNullOrEmpty.

      Parameters:
      s - a String object
      Returns:
      a boolean
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Vector v)

      isNullOrEmpty.

      Parameters:
      v - a Vector object
      Returns:
      a boolean
    • clone

      public static byte[] clone(byte[] data)

      clone.

      Parameters:
      data - an array of
      invalid reference
      byte
      objects
      Returns:
      an array of
      invalid reference
      byte
      objects
    • clone

      public static String[] clone(String[] s)

      clone.

      Parameters:
      s - an array of String objects
      Returns:
      an array of String objects
    • constantTimeAreEqual

      public static boolean constantTimeAreEqual(int len, byte[] a, int aOff, byte[] b, int bOff)

      constantTimeAreEqual.

      Parameters:
      len - a int
      a - an array of
      invalid reference
      byte
      objects
      aOff - a int
      b - an array of
      invalid reference
      byte
      objects
      bOff - a int
      Returns:
      a boolean
    • copyOfRangeExact

      public static byte[] copyOfRangeExact(byte[] original, int from, int to)

      copyOfRangeExact.

      Parameters:
      original - an array of
      invalid reference
      byte
      objects
      from - a int
      to - a int
      Returns:
      an array of
      invalid reference
      byte
      objects
    • vectorOfOne

      public static Vector vectorOfOne(Object obj)

      vectorOfOne.

      Parameters:
      obj - a Object object
      Returns:
      a Vector object
    • getCommonCipherSuites

      public static int[] getCommonCipherSuites(int[] peerCipherSuites, int[] localCipherSuites, boolean useLocalOrder)

      getCommonCipherSuites.

      Parameters:
      peerCipherSuites - an array of
      invalid reference
      int
      objects
      localCipherSuites - an array of
      invalid reference
      int
      objects
      useLocalOrder - a boolean
      Returns:
      an array of
      invalid reference
      int
      objects
    • containsNonAscii

      public static boolean containsNonAscii(byte[] bs)

      containsNonAscii.

      Parameters:
      bs - an array of
      invalid reference
      byte
      objects
      Returns:
      a boolean
    • containsNonAscii

      public static boolean containsNonAscii(String s)

      containsNonAscii.

      Parameters:
      s - a String object
      Returns:
      a boolean