private String getValueDescription(final Object o) {
        if (o == null) {
            return null;
        }

        if (o instanceof Number) {
            return o.toString();
        }
        if (o instanceof String) {
            return "'" + o.toString().trim() + "'";
        }
        if (o instanceof Date) {
            final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.ROOT);
            return df.format((Date) o);
        }
        if (o instanceof Object[]) {
            final Object[] objects = (Object[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < objects.length; i++) {
                final Object object = objects[i];

                if (i > 50) {
                    result.append("... (").append(objects.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(object.toString());
            }
            return result.toString();
            // } else if (o instanceof Number[])
            // {
            // Number[] numbers = (Number[]) o;
            // StringBuilder result = new StringBuilder();
            //
            // for (int i = 0; i < numbers.length; i++)
            // {
            // Number number = numbers[i];
            //
            // if (i > 0)
            // result.append(", ");
            // result.append("" + number);
            // }
            // return result.toString();
            // }
        }
        if (o instanceof short[]) {
            final short[] values = (short[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final short sVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(sVal);
            }
            return result.toString();
        }
        if (o instanceof int[]) {
            final int[] values = (int[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final int iVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(iVal);
            }
            return result.toString();
        }
        if (o instanceof long[]) {
            final long[] values = (long[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final long lVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(lVal);
            }
            return result.toString();
        }
        if (o instanceof double[]) {
            final double[] values = (double[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final double dVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(dVal);
            }
            return result.toString();
        }
        if (o instanceof byte[]) {
            final byte[] values = (byte[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final byte bVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(bVal);
            }
            return result.toString();
        }
        if (o instanceof char[]) {
            final char[] values = (char[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final char cVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(cVal);
            }
            return result.toString();
        }
        if (o instanceof float[]) {
            final float[] values = (float[]) o;
            final StringBuilder result = new StringBuilder();

            for (int i = 0; i < values.length; i++) {
                final float fVal = values[i];

                if (i > 50) {
                    result.append("... (").append(values.length).append(")");
                    break;
                }
                if (i > 0) {
                    result.append(", ");
                }
                result.append(fVal);
            }
            return result.toString();
        }
        // else if (o instanceof short[])
        // {
        // short[] numbers = (short[]) o;
        // StringBuilder result = new StringBuilder();
        //
        // for (int i = 0; i < numbers.length; i++)
        // {
        // short number = numbers[i];
        //
        // if (i > 0)
        // result.append(", ");
        // result.append("" + number);
        // }
        // return result.toString();
        // }

        return "Unknown: " + o.getClass().getName();
    }
Returns the field's tag, derived from bytes 0-1.

@return the tag, as an {@code int} in which only the lowest 2 bytes are set
src/main/java/org/apache/commons/imaging/formats/tiff/TiffField.java