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)
StateHandle
getState
in interface StateHandle<InputStream>
userCodeClassLoader
- Class loader for deserializing user code specific classespublic void discardState()
StateHandle
discardState
in interface StateHandle<InputStream>
public long getStateSize()
StateHandle
If the the size is not known, return 0
.
getStateSize
in interface StateHandle<InputStream>
public <T extends Serializable> StateHandle<T> toSerializableHandle()
StreamStateHandle
toSerializableHandle
in interface StreamStateHandle
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.