Package org.cometd.bayeux
Class BinaryData
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- org.cometd.bayeux.BinaryData
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,Object>
public class BinaryData extends HashMap<String,Object>
Reified representation of binary data chunk contained in a message.
BinaryData is composed of a
metaData map
that contains application information about the binary chunk (such as a file name, the mime type, or the chunk number), of the binary chunk itself (either inbyte[]
orByteBuffer
format), and of the booleanlast flag
indicating whether it is the last chunk.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description BinaryData(byte[] bytes, boolean last, Map<String,Object> metaData)
BinaryData(ByteBuffer byteBuffer, boolean last, Map<String,Object> metaData)
BinaryData(Map<? extends String,?> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuffer
asByteBuffer()
byte[]
asBytes()
Map<String,Object>
getMetaData()
boolean
isLast()
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
EXT_NAME
public static final String EXT_NAME
- See Also:
- Constant Field Values
-
META
public static final String META
- See Also:
- Constant Field Values
-
DATA
public static final String DATA
- See Also:
- Constant Field Values
-
LAST
public static final String LAST
- See Also:
- Constant Field Values
-
-
Method Detail
-
asByteBuffer
public ByteBuffer asByteBuffer()
- Returns:
- the binary chunk as
ByteBuffer
-
asBytes
public byte[] asBytes()
- Returns:
- the binary chunk as
byte[]
-
isLast
public boolean isLast()
- Returns:
- whether the binary chunk is the last
-
-