Class ByteArrayMatcher

java.lang.Object
org.hamcrest.BaseMatcher<byte[]>
io.github.cjstehno.testthings.match.ByteArrayMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<byte[]>, org.hamcrest.SelfDescribing

public abstract class ByteArrayMatcher extends org.hamcrest.BaseMatcher<byte[]>
Hamcrest matchers for working with byte arrays.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.hamcrest.Matcher<byte[]>
    arrayContains(byte[] sub)
    Matches a sub-array of bytes in the provided byte array.
    static org.hamcrest.Matcher<byte[]>
    arrayEqualTo(byte[] bytes)
    Matches a byte array equal to the provided byte array.
    static org.hamcrest.Matcher<byte[]>
    arrayLengthIs(int length)
    Matches a byte array with the specified length.
    static org.hamcrest.Matcher<byte[]>
    arrayStartsWith(byte[] prefix)
    Matches a byte array starting with the provided byte array.

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.hamcrest.Matcher

    matches

    Methods inherited from interface org.hamcrest.SelfDescribing

    describeTo
  • Constructor Details

    • ByteArrayMatcher

      public ByteArrayMatcher()
  • Method Details

    • arrayEqualTo

      public static org.hamcrest.Matcher<byte[]> arrayEqualTo(byte[] bytes)
      Matches a byte array equal to the provided byte array.
      Parameters:
      bytes - the byte array
      Returns:
      the matcher
    • arrayStartsWith

      public static org.hamcrest.Matcher<byte[]> arrayStartsWith(byte[] prefix)
      Matches a byte array starting with the provided byte array.
      Parameters:
      prefix - the prefix bytes
      Returns:
      the matcher
    • arrayContains

      public static org.hamcrest.Matcher<byte[]> arrayContains(byte[] sub)
      Matches a sub-array of bytes in the provided byte array.
      Parameters:
      sub - the sub-array
      Returns:
      the matcher
    • arrayLengthIs

      public static org.hamcrest.Matcher<byte[]> arrayLengthIs(int length)
      Matches a byte array with the specified length.
      Parameters:
      length - the byte array length
      Returns:
      the matcher