@Immutable @MustImplementEqualsAndHashcode public class MimeTypeContent extends Object
IMimeType.| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_COPY_BYTES |
| Constructor and Description |
|---|
MimeTypeContent(byte[] aContentBytes,
boolean bCopyBytes,
IMimeType aMimeType)
Constructor
|
MimeTypeContent(byte[] aContentBytes,
IMimeType aMimeType)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
byte[] |
getAllContentBytes() |
int |
getContentByteCount() |
IMimeType |
getMimeType() |
int |
hashCode() |
boolean |
matchesBeginning(byte[] aCmpBytes)
Check if the passed byte array starts with the bytes of this object.
|
String |
toString() |
void |
writeContentBytes(OutputStream aOS)
Write the content bytes to the specified output stream.
|
public static final boolean DEFAULT_COPY_BYTES
public MimeTypeContent(@Nonnull @Nonempty byte[] aContentBytes, @Nonnull IMimeType aMimeType)
aContentBytes - The beginning bytes. May neither be null nor empty.aMimeType - The corresponding mime type. May not be null.public MimeTypeContent(@Nonnull @Nonempty byte[] aContentBytes, boolean bCopyBytes, @Nonnull IMimeType aMimeType)
aContentBytes - The beginning bytes. May neither be null nor empty.bCopyBytes - true to copy the bytes, false to reuse the
provided instance.aMimeType - The corresponding mime type. May not be null.@Nonnull @Nonempty @ReturnsMutableCopy public byte[] getAllContentBytes()
null nor
empty.@Nonnegative public int getContentByteCount()
public void writeContentBytes(@Nonnull @WillNotClose OutputStream aOS) throws IOException
aOS - The output stream to write to. The stream is NOT closed. May not be
null.IOException - In case of a write errorpublic boolean matchesBeginning(@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–2022 Philip Helger. All rights reserved.