Java Assert Not Null assertNotNullEightBytes(byte[] bytes)

Here you can find the source of assertNotNullEightBytes(byte[] bytes)

Description

assert Not Null Eight Bytes

License

Apache License

Declaration

public static void assertNotNullEightBytes(byte[] bytes) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void assertNotNullEightBytes(byte[] bytes) {
        if (bytes == null) {
            throw new IllegalArgumentException("Expected 8 bytes, but got null.");
        }// w  ww.j a v a2 s. c  o m
        if (bytes.length != 8) {
            throw new IllegalArgumentException(String.format("Expected 8 bytes, but got: %d bytes.", bytes.length));
        }
    }
}

Related

  1. assertNotNull(T obj)
  2. assertNotNull(T object, String fieldName)
  3. assertNotNull(T value, String message)
  4. assertNotNullArg(Object value, String argName)
  5. assertNotNullArgument(Object obj, String argName)
  6. assertNotNullNotEmpty(String obj, String paramName)
  7. assertNotNullOrThrowException(final Object... objects)
  8. assertObjectNotNull(final Object object)
  9. assertObjectNotNull(Object o, String name)