Interface IHasByteArray

    • Method Detail

      • isCopy

        boolean isCopy()
        Returns:
        true if the contained byte array was copied in the constructor or not.
      • bytes

        @Nonnull
        @ReturnsMutableObject
        byte[] bytes()
        Returns:
        A reference to the contained byte array. Gives write access to the payload! Never null.
      • getOffset

        @Nonnegative
        int getOffset()
        Returns:
        The offset into the byte array to start reading. This is always 0 when copied. Must be ge; 0.
        See Also:
        bytes(), IHasSize.size()
      • hasOffset

        default boolean hasOffset()
        Returns:
        true if an offset is present, false if not.
      • writeTo

        default void writeTo​(@Nonnull @WillNotClose
                             OutputStream aOS)
                      throws IOException
        Write the relevant part of the byte array onto the provided output stream.
        Parameters:
        aOS - The output stream to write to. May not be null.
        Throws:
        IOException - In case of a write error.
      • startsWith

        default boolean startsWith​(@Nonnull
                                   byte[] aCmpBytes)
        Check if the passed byte array starts with the bytes of this object.
        Parameters:
        aCmpBytes - The bytes to compare to. May not be null.
        Returns:
        true if the passed bytes start with the bytes in this object.
      • getHexEncoded

        @Nonnull
        default String getHexEncoded()
        Returns:
        The hex encoded version of this string. Never null but maybe empty, if the underlying array length is empty.