Class Data
- java.lang.Object
-
- org.apache.qpid.protonj2.types.messaging.Data
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.protonj2.types.messaging.Section
Section.SectionType
-
-
Field Summary
Fields Modifier and Type Field Description static UnsignedLongDESCRIPTOR_CODEstatic SymbolDESCRIPTOR_SYMBOL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Datacopy()booleanequals(java.lang.Object obj)BinarygetBinary()ProtonBuffergetBuffer()Returns theProtonBufferthat contains the bytes carried in theDatasection.Section.SectionTypegetType()byte[]getValue()Returns the backing array for this DataSectioncopying the contents into a new array instance if the backing array in the contained Binary is a subsequence of a larger referenced array instance.inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
DESCRIPTOR_CODE
public static final UnsignedLong DESCRIPTOR_CODE
-
DESCRIPTOR_SYMBOL
public static final Symbol DESCRIPTOR_SYMBOL
-
-
Constructor Detail
-
Data
public Data(Binary binary)
-
Data
public Data(ProtonBuffer buffer)
-
Data
public Data(byte[] value)
-
Data
public Data(byte[] value, int offset, int length)
-
-
Method Detail
-
copy
public Data copy()
-
getBinary
public Binary getBinary()
-
getBuffer
public ProtonBuffer getBuffer()
Returns theProtonBufferthat contains the bytes carried in theDatasection. If the section carries no bytes then this method returns null. This method allows theDatasection to be considered a carrier ofProtonBuffertypes instead of theBinaryvalue it will encode as part of its body and avoids creation of a Binary object when one is not needed. If a Binary instance is required then calling thegetBinary()method will create an instance that wraps the internalProtonBuffer.- Returns:
- the
ProtonBufferthat back this Data section.
-
getValue
public byte[] getValue()
Returns the backing array for this DataSectioncopying the contents into a new array instance if the backing array in the contained Binary is a subsequence of a larger referenced array instance.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getType
public Section.SectionType getType()
- Specified by:
getTypein interfaceSection<byte[]>- Returns:
- the
Section.SectionTypethat describes this instance.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-