public long[] getLongArrayValue() throws ImagingException {
        final Object o = getValue();
        if (o instanceof Number) {
            return new long[] { ((Number) o).longValue() };
        }
        if (o instanceof Number[]) {
            final Number[] numbers = (Number[]) o;
            final long[] result = Allocator.longArray(numbers.length);
            Arrays.setAll(result, i -> numbers[i].longValue());
            return result;
        }
        if (o instanceof short[]) {
            final short[] numbers = (short[]) o;
            final long[] result = Allocator.longArray(numbers.length);
            Arrays.setAll(result, i -> 0xffff & numbers[i]);
            return result;
        }
        if (o instanceof int[]) {
            final int[] numbers = (int[]) o;
            final long[] result = Allocator.longArray(numbers.length);
            Arrays.setAll(result, i -> 0xFFFFffffL & numbers[i]);
            return result;
        }
        if (o instanceof long[]) {
            final long[] numbers = (long[]) o;
            return Arrays.copyOf(numbers, numbers.length);
        }

        throw new ImagingException("Unknown value: " + o + " for: " + getTagInfo().getDescription());
    }
Gets the value of the field in the form of an array of eight-byte (long) integers.

@return an valid array of size zero or larger giving signed long integer values.
@throws ImagingException if the field instance is of an incompatible type or does not contain a valid data element.
src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java