Interface Binary

    • Field Detail

      • EMPTY_BYTE_ARRAY

        static final byte[] EMPTY_BYTE_ARRAY
        An empty byte array (no data).
    • Method Detail

      • getDataByte

        byte getDataByte​(int index)
        Parameters:
        index - the index of the requested byte starting from 1.
        Returns:
        the requested byte. If the given index exceeds the data (is greater or equal to length) 0 is returned.
      • getData

        byte[] getData()
        ATTENTION:
        Sub-types often represent sensible data. Be careful to pass these data in raw form (unencrypted).
        Returns:
        the raw encoded data. Array will be copied to prevent manipulation. Hence, this method is expensive and subsequent calls shall be avoided.
      • getData

        void getData​(byte[] buffer,
                     int offset)
        Copies the data into the given buffer.
        Parameters:
        buffer - the byte array to copy the data to. Has to have enough capacity left for the length of this BLOB.
        offset - the index where to start copying to buffer.
      • getLength

        int getLength()
        Returns:
        the length of this BLOB in bytes (array length of getData()).
      • formatHex

        default String formatHex()
        ATTENTION:
        Sub-types often represent sensible data. Be careful to pass the data in raw form (unencrypted).
        Returns:
        a hex-dump of this BLOB. This form is more transparent but less compact to base 64 representation.
      • formatBase64

        default String formatBase64()
        ATTENTION:
        Sub-types often represent sensible data. Be careful to pass the data in raw form (unencrypted).
        Returns:
        a Base64 encoded String representation of this BLOB. Base64 representation is more compact and therefore useful for larger BLOBs while hex is more transparent to read for humans.
      • isZeros

        boolean isZeros()
        Returns:
        true if the data contains only zeros (0 values), false otherwise.