Class BinaryDataBuffer

java.lang.Object
com.tridion.data.BinaryDataBuffer
All Implemented Interfaces:
BinaryData

public class BinaryDataBuffer extends Object implements BinaryData
Binary data object that is stored in memory.
  • Constructor Details

    • BinaryDataBuffer

      public BinaryDataBuffer(int namespaceId, int publicationId, int binaryId, byte[] binaryContent)
      Creates a new instance of this object.
      Parameters:
      namespaceId - The namespace id.
      publicationId - The publication id.
      binaryId - The binary id.
      binaryContent - The byte array containing the binary data.
    • BinaryDataBuffer

      public BinaryDataBuffer(int namespaceId, int publicationId, int binaryId, byte[] binaryContent, String variantId)
  • Method Details

    • getBytes

      public byte[] getBytes() throws IOException
      Gets the binary data as an array of bytes.
      Specified by:
      getBytes in interface BinaryData
      Returns:
      byte[] representation of the binary data.
      Throws:
      IOException - If an error occurs accessing the binary data.
    • getId

      public int getId()
      Gets the id of this binary data.
      Specified by:
      getId in interface BinaryData
      Returns:
      The binary data id.
    • getVariantId

      public String getVariantId()
      Returns the id of the variant for this binary data.
      Specified by:
      getVariantId in interface BinaryData
    • getInputStream

      public InputStream getInputStream() throws IOException
      Gets an InputStream representing the binary data.
      Specified by:
      getInputStream in interface BinaryData
      Returns:
      The binary data as an InputStream.
      Throws:
      IOException - If an error occurs accessing the binary data.
    • getNamespaceId

      public int getNamespaceId()
      Description copied from interface: BinaryData
      Gets the namespace id.
      Specified by:
      getNamespaceId in interface BinaryData
      Returns:
      namespace id
    • getPublicationId

      public int getPublicationId()
      Description copied from interface: BinaryData
      Gets the publication id of this binary data.
      Specified by:
      getPublicationId in interface BinaryData
      Returns:
      The publication id.
    • getDataSize

      public long getDataSize()
      Gets the size of underlying binary data.
      Specified by:
      getDataSize in interface BinaryData
      Returns:
      The binary data size.