Package org.cometd.bayeux
Class BinaryData
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<java.lang.String,java.lang.Object>
org.cometd.bayeux.BinaryData
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.Object>
public class BinaryData
extends java.util.HashMap<java.lang.String,java.lang.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 in byte[]
or
ByteBuffer
format), and of the boolean
last flag
indicating whether it is the last chunk.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,V extends java.lang.Object>
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BinaryData(byte[] bytes, boolean last, java.util.Map<java.lang.String,java.lang.Object> metaData)
BinaryData(java.nio.ByteBuffer byteBuffer, boolean last, java.util.Map<java.lang.String,java.lang.Object> metaData)
BinaryData(java.util.Map<? extends java.lang.String,?> map)
-
Method Summary
Modifier and Type Method Description java.nio.ByteBuffer
asByteBuffer()
byte[]
asBytes()
java.util.Map<java.lang.String,java.lang.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
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
equals, hashCode
-
Field Details
-
EXT_NAME
public static final java.lang.String EXT_NAME- See Also:
- Constant Field Values
-
META
public static final java.lang.String META- See Also:
- Constant Field Values
-
DATA
public static final java.lang.String DATA- See Also:
- Constant Field Values
-
LAST
public static final java.lang.String LAST- See Also:
- Constant Field Values
-
-
Constructor Details
-
BinaryData
public BinaryData(java.nio.ByteBuffer byteBuffer, boolean last, java.util.Map<java.lang.String,java.lang.Object> metaData) -
BinaryData
public BinaryData(byte[] bytes, boolean last, java.util.Map<java.lang.String,java.lang.Object> metaData) -
BinaryData
public BinaryData(java.util.Map<? extends java.lang.String,?> map)
-
-
Method Details
-
asByteBuffer
public java.nio.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
-
getMetaData
public java.util.Map<java.lang.String,java.lang.Object> getMetaData()- Returns:
- the meta data associated with the binary chunk
-