Package com.tridion.data
Class BinaryDataBuffer
java.lang.Object
com.tridion.data.BinaryDataBuffer
- All Implemented Interfaces:
BinaryData
Binary data object that is stored in memory.
-
Constructor Summary
ConstructorsConstructorDescriptionBinaryDataBuffer(int namespaceId, int publicationId, int binaryId, byte[] binaryContent) Creates a new instance of this object.BinaryDataBuffer(int namespaceId, int publicationId, int binaryId, byte[] binaryContent, String variantId) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Gets the binary data as an array of bytes.longGets the size of underlying binary data.intgetId()Gets the id of this binary data.Gets anInputStreamrepresenting the binary data.intGets the namespace id.intGets the publication id of this binary data.Returns the id of the variant for this binary data.
-
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
Gets the binary data as an array of bytes.- Specified by:
getBytesin interfaceBinaryData- 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:
getIdin interfaceBinaryData- Returns:
- The binary data id.
-
getVariantId
Returns the id of the variant for this binary data.- Specified by:
getVariantIdin interfaceBinaryData
-
getInputStream
Gets anInputStreamrepresenting the binary data.- Specified by:
getInputStreamin interfaceBinaryData- 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:BinaryDataGets the namespace id.- Specified by:
getNamespaceIdin interfaceBinaryData- Returns:
- namespace id
-
getPublicationId
public int getPublicationId()Description copied from interface:BinaryDataGets the publication id of this binary data.- Specified by:
getPublicationIdin interfaceBinaryData- Returns:
- The publication id.
-
getDataSize
public long getDataSize()Gets the size of underlying binary data.- Specified by:
getDataSizein interfaceBinaryData- Returns:
- The binary data size.
-