T - the object typepublic class DefaultSerialization<T> extends Object implements Serialization<T>
Serialization using the built-in Java serialization facility.
Clients can inherit this class.Serializable| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultSerialization.ObjectSink<T>
An
ObjectOutput adapter implementation of Sink. |
static class |
DefaultSerialization.ObjectSource<T>
An
ObjectInput adapter implementation of Source. |
| Constructor and Description |
|---|
DefaultSerialization() |
| Modifier and Type | Method and Description |
|---|---|
protected ObjectInput |
createObjectInput(InputStream stream)
Creates an
ObjectInput object from the InputStream. |
protected ObjectOutput |
createObjectOutput(OutputStream stream)
Creates an
ObjectOutput object from the OutputStream. |
Sink<T> |
createSink(OutputStream stream)
Creates a new
Sink using the OutputStream. |
Source<T> |
createSource(InputStream stream)
Creates a new
Source using the InputStream. |
public Source<T> createSource(InputStream stream) throws IOException, InterruptedException
SerializationSource using the InputStream.createSource in interface Serialization<T>stream - the InputStream which contains serialized formSourceIOException - if failed to create a source by I/O errorInterruptedException - if interrupted while preparing the sourcepublic Sink<T> createSink(OutputStream stream) throws IOException, InterruptedException
SerializationSink using the OutputStream.createSink in interface Serialization<T>stream - the OutputStream which contains serialized formSinkIOException - if failed to create a sink by I/O errorInterruptedException - if interrupted while preparing the sinkprotected ObjectInput createObjectInput(InputStream stream) throws IOException, InterruptedException
stream - the source InputStreamObjectInput which takes objects from the sourceIOException - if failed to create ObjectInput by I/O errorInterruptedException - if interrupted while preparing ObjectInputprotected ObjectOutput createObjectOutput(OutputStream stream) throws IOException, InterruptedException
ObjectOutput object from the OutputStream.
This implementation returns ObjectOutputStream.stream - the target OutputStreamObjectOutput which puts objects into the targetIOException - if failed to create ObjectOutput by I/O errorInterruptedException - if interrupted while preparing ObjectOutputCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.