Package org.midheaven.io
Class ByteContent
java.lang.Object
org.midheaven.io.ByteContent
- Direct Known Subclasses:
NamedByteContent
Represents Byte Content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteContentBuildercreate()Performs create.final booleanPerforms equals.final ByteContentFormatformat()Performs format.booleanhasSameContentAs(ByteContent other) Checks whether has Same Content As.abstract booleanisEmpty()Checks whether is Empty.abstract byte[]Performs readAllBytes.Performs readAsInputStream.Performs readAsText.abstract ByteContentSizesize()Performs size.voidwriteTo(OutputStream out) Writes the content to an OutputStream but does not close it
-
Constructor Details
-
ByteContent
Creates a new ByteContent.- Parameters:
format- the format value
-
-
Method Details
-
create
Performs create.- Returns:
- the result of create
-
format
Performs format.- Returns:
- the result of format
-
readAsText
Performs readAsText.- Returns:
- the result of readAsText
-
readAsInputStream
Performs readAsInputStream.- Returns:
- the result of readAsInputStream
-
writeTo
Writes the content to an OutputStream but does not close it- Parameters:
out-- Throws:
IoException
-
equals
Performs equals. -
hasSameContentAs
Checks whether has Same Content As.- Parameters:
other- the other value- Returns:
- the result of hasSameContentAs
-
readAllBytes
public abstract byte[] readAllBytes()Performs readAllBytes.- Returns:
- the result of readAllBytes
-
isEmpty
public abstract boolean isEmpty()Checks whether is Empty.- Returns:
- the result of isEmpty
-
size
Performs size.- Returns:
- the result of size
-