public void setData(final byte[] bytes) throws ImagingException {
        // if (tagInfo.isUnknown())
        // Debug.debug("unknown tag(0x" + Integer.toHexString(tag)
        // + ") setData", bytes);

        if (this.bytes.length != bytes.length) {
            throw new ImagingException("Cannot change size of value.");
        }

        // boolean wasLocalValue = isLocalValue();
        this.bytes = bytes;
        if (separateValueItem != null) {
            separateValueItem.updateValue(bytes);
        }
        // if (isLocalValue() != wasLocalValue)
        // throw new Error("Bug. Locality disrupted! "
        // + tagInfo.getDescription());
    }
Set the data for this TIFF output field.

@param bytes TIFF output field data.
@throws ImagingException if the length of the bytes array do not match.
src/main/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputField.java