public final class ByteStreamStateHandle extends Object implements StreamStateHandle
| Constructor and Description |
|---|
ByteStreamStateHandle(byte[] data)
Creates a new ByteStreamStateHandle containing the given data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
discardState()
Discards the state referred to by this handle, to free up resources in
the persistent storage.
|
InputStream |
getState(ClassLoader userCodeClassLoader)
This retrieves and return the state represented by the handle.
|
long |
getStateSize()
Returns the size of the state in bytes.
|
<T extends Serializable> |
toSerializableHandle()
Converts this stream state handle into a state handle that de-serializes
the stream into an object using Java's serialization mechanism.
|
public ByteStreamStateHandle(byte[] data)
data - The state data.public InputStream getState(ClassLoader userCodeClassLoader)
StateHandlegetState in interface StateHandle<InputStream>userCodeClassLoader - Class loader for deserializing user code specific classespublic void discardState()
StateHandlediscardState in interface StateHandle<InputStream>public long getStateSize()
StateHandleIf the the size is not known, return 0.
getStateSize in interface StateHandle<InputStream>public <T extends Serializable> StateHandle<T> toSerializableHandle()
StreamStateHandletoSerializableHandle in interface StreamStateHandleCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.