Class ByteContent

java.lang.Object
org.midheaven.io.ByteContent
Direct Known Subclasses:
NamedByteContent

public abstract class ByteContent extends Object
Represents Byte Content.
  • Constructor Details

    • ByteContent

      public ByteContent(ByteContentFormat format)
      Creates a new ByteContent.
      Parameters:
      format - the format value
  • Method Details

    • create

      public static ByteContentBuilder create()
      Performs create.
      Returns:
      the result of create
    • format

      public final ByteContentFormat format()
      Performs format.
      Returns:
      the result of format
    • readAsText

      public String readAsText()
      Performs readAsText.
      Returns:
      the result of readAsText
    • readAsInputStream

      public InputStream readAsInputStream()
      Performs readAsInputStream.
      Returns:
      the result of readAsInputStream
    • writeTo

      public void writeTo(OutputStream out) throws IoException
      Writes the content to an OutputStream but does not close it
      Parameters:
      out -
      Throws:
      IoException
    • equals

      public final boolean equals(Object other)
      Performs equals.
      Overrides:
      equals in class Object
      Parameters:
      other - the other value
      Returns:
      the result of equals
    • hasSameContentAs

      public boolean hasSameContentAs(ByteContent other)
      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

      public abstract ByteContentSize size()
      Performs size.
      Returns:
      the result of size