public interface IHasByteArray extends IHasSize, IHasInputStreamAndReader
| Modifier and Type | Method and Description |
|---|---|
byte[] |
bytes() |
default byte[] |
getAllBytes() |
default String |
getHexEncoded() |
default InputStream |
getInputStream()
Get the input stream to read from the object.
|
int |
getOffset() |
default boolean |
hasOffset() |
boolean |
isCopy() |
default boolean |
isEmpty() |
default boolean |
isNotEmpty() |
default boolean |
isReadMultiple()
Check if the
InputStream from IHasInputStream.getInputStream() and
IHasInputStream.getBufferedInputStream() can be acquired more than once. |
default boolean |
startsWith(byte[] aCmpBytes)
Check if the passed byte array starts with the bytes of this object.
|
default void |
writeTo(OutputStream aOS)
Write the relevant part of the byte array onto the provided output stream.
|
getBufferedReader, getReadergetBufferedInputStreamdefault boolean isEmpty()
isEmpty in interface IHasSizetrue if no items are present, false if at
least a single item is present.IHasSize.size(),
IHasSize.isNotEmpty()default boolean isNotEmpty()
isNotEmpty in interface IHasSizetrue if at least one item is present,
false if no item is present.IHasSize.size(),
IHasSize.isEmpty()boolean isCopy()
true if the contained byte array was copied in the
constructor or not.@Nonnull @ReturnsMutableCopy default byte[] getAllBytes()
null.@Nonnull @ReturnsMutableObject byte[] bytes()
null.@Nonnegative int getOffset()
bytes(),
IHasSize.size()default boolean hasOffset()
true if an offset is present, false if
not.@Nonnull default InputStream getInputStream()
IHasInputStreamInputStream needs to be created.getInputStream in interface IHasInputStreamnull if resolving failed.default boolean isReadMultiple()
IHasInputStreamInputStream from IHasInputStream.getInputStream() and
IHasInputStream.getBufferedInputStream() can be acquired more than once.isReadMultiple in interface IHasInputStreamtrue if the input stream can be acquired more than
once, false if not.default void writeTo(@Nonnull @WillNotClose OutputStream aOS) throws IOException
aOS - The output stream to write to. May not be null.IOException - In case of a write error.default boolean startsWith(@Nonnull byte[] aCmpBytes)
aCmpBytes - The bytes to compare to. May not be null.true if the passed bytes start with the bytes in this
object.Copyright © 2014–2020 Philip Helger. All rights reserved.