public class BinaryResourceImpl extends ResourceImpl
Modifier and Type | Class and Description |
---|---|
static class |
BinaryResourceImpl.BinaryIO |
static class |
BinaryResourceImpl.DataConverter<T>
Generally this abstract class is extended as a stateless singleton returned by a generated factory that implements the
factory interface. |
static class |
BinaryResourceImpl.EObjectInputStream |
static class |
BinaryResourceImpl.EObjectOutputStream |
ResourceImpl.ContentsEList<E extends java.lang.Object & EObject>, ResourceImpl.ModificationTrackingAdapter
BasicNotifierImpl.EAdapterList<E extends java.lang.Object & Adapter>, BasicNotifierImpl.EObservableAdapterList
Resource.Diagnostic, Resource.Factory, Resource.Internal, Resource.IOWrappedException
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_CAPACITY
The default
OPTION_BUFFER_CAPACITY capacity of the buffered stream
used when saving or loading the resource content. |
static java.lang.String |
OPTION_BUFFER_CAPACITY
|
static java.lang.String |
OPTION_EAGER_PROXY_RESOLUTION
A Boolean load option to specify whether proxies should be eagerly resolved during loading.
|
static java.lang.String |
OPTION_INTERNAL_BUFFER_CAPACITY
Specify the capacity of the internal byte array used in
BinaryResourceImpl.EObjectInputStream or BinaryResourceImpl.EObjectOutputStream for buffering the reading and writing of bytes. |
static java.lang.String |
OPTION_STYLE_BINARY_DATE
A Boolean save option to specify whether
date values will be serialized using Date.getTime() rather than a string representation. |
static java.lang.String |
OPTION_STYLE_BINARY_ENUMERATOR
A Boolean save option to specify whether
enumerator values will be serialized using Enumerator.getValue() rather than a string representation. |
static java.lang.String |
OPTION_STYLE_BINARY_FLOATING_POINT
A Boolean save option to specify whether float and double values
are encoded using
Float.floatToIntBits(float) and Double.doubleToLongBits(double) respectively,
rather than a string representation. |
static java.lang.String |
OPTION_STYLE_DATA_CONVERTER
A Boolean save option to specify whether values should be serialized using
data converters . |
static java.lang.String |
OPTION_STYLE_PROXY_ATTRIBUTES
A Boolean save option to specify whether serialized proxies will include the serialization of their attribute values.
|
static java.lang.String |
OPTION_VERSION
A save option to specify the
BinaryResourceImpl.BinaryIO.Version to be used for the serialization. |
contents, defaultDeleteOptions, defaultLoadOptions, defaultSaveOptions, errors, intrinsicIDToEObjectMap, isLoaded, isLoading, isModified, modificationTrackingAdapter, resourceSet, timeStamp, unloadingContents, uri, warnings
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
OPTION_CIPHER, OPTION_LINE_DELIMITER, OPTION_LINE_DELIMITER_UNSPECIFIED, OPTION_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS
Constructor and Description |
---|
BinaryResourceImpl() |
BinaryResourceImpl(URI uri) |
Modifier and Type | Method and Description |
---|---|
protected BinaryResourceImpl.EObjectInputStream |
createEObjectInputStream(java.io.InputStream inputStream,
java.util.Map<?,?> options) |
protected BinaryResourceImpl.EObjectOutputStream |
createEObjectOutputStream(java.io.OutputStream outputStream,
java.util.Map<?,?> options) |
protected void |
doLoad(java.io.InputStream inputStream,
java.util.Map<?,?> options)
Called to load the resource.
|
protected void |
doSave(java.io.OutputStream outputStream,
java.util.Map<?,?> options)
Called to save the resource.
|
static int |
getBufferCapacity(java.util.Map<?,?> options)
Extract the
OPTION_BUFFER_CAPACITY from the options. |
static int |
getInternalBufferCapacity(java.util.Map<?,?> options)
Extract the
OPTION_INTERNAL_BUFFER_CAPACITY from the options. |
addModificationTrackingAdapters, attached, attachedHelper, basicSetResourceSet, createModificationTrackingAdapter, delete, detached, detachedHelper, doUnload, getAllContents, getAllProperContents, getAllProperContents, getContents, getDefaultURIConverter, getEObject, getEObject, getEObjectByID, getEObjectForURIFragmentRootSegment, getErrors, getIntrinsicIDToEObjectMap, getResourceSet, getTimeStamp, getURI, getURIConverter, getURIFragment, getURIFragmentRootSegment, getWarnings, handleLoadResponse, handleSaveResponse, isAttachedDetachedHelperRequired, isContentZipEntry, isLoaded, isLoading, isModified, isTrackingModification, load, load, mergeMaps, newContentZipEntry, removeModificationTrackingAdapters, save, save, saveOnlyIfChangedWithFileBuffer, saveOnlyIfChangedWithMemoryBuffer, setIntrinsicIDToEObjectMap, setLoaded, setModified, setTimeStamp, setTrackingModification, setURI, toKeyString, toString, unload, unloaded, useZip
eAdapters, eBasicAdapters, eDeliver, eSetDeliver
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
eAdapters, eDeliver, eNotify, eSetDeliver
public static final java.lang.String OPTION_VERSION
BinaryResourceImpl.BinaryIO.Version
to be used for the serialization.BinaryResourceImpl.BinaryIO.Version
,
Constant Field Valuespublic static final java.lang.String OPTION_STYLE_BINARY_FLOATING_POINT
Float.floatToIntBits(float)
and Double.doubleToLongBits(double)
respectively,
rather than a string representation.
The default is true.
This style option is only supported for serializations with version 1.1
or higher.BinaryResourceImpl.BinaryIO.STYLE_BINARY_FLOATING_POINT
,
Constant Field Valuespublic static final java.lang.String OPTION_STYLE_BINARY_DATE
date
values will be serialized using Date.getTime()
rather than a string representation.
This style option is only supported for serializations with version 1.1
or higher.
The default is false.BinaryResourceImpl.BinaryIO.STYLE_BINARY_DATE
,
Constant Field Valuespublic static final java.lang.String OPTION_STYLE_PROXY_ATTRIBUTES
version 1.1
or higher.
The default is false.BinaryResourceImpl.BinaryIO.STYLE_PROXY_ATTRIBUTES
,
Constant Field Valuespublic static final java.lang.String OPTION_STYLE_BINARY_ENUMERATOR
enumerator
values will be serialized using Enumerator.getValue()
rather than a string representation.
This style option is only supported for serializations with version 1.1
or higher.
The default is false.BinaryResourceImpl.BinaryIO.STYLE_BINARY_ENUMERATOR
,
Constant Field Valuespublic static final java.lang.String OPTION_STYLE_DATA_CONVERTER
data converters
.
In general, a value will use a data converter only if the factory
of the data type
implements its data converter factory
to return a non-null data converter.
If that data converter specifies that values should be tabulated
,
every unique
value will be serialized in full at most once.
Note that String values have specialized built-in data converter support and will hence also be tabulated if this option is specified.
This style option is only supported for serializations with version 1.1
or higher.
The default value is false.public static final java.lang.String OPTION_EAGER_PROXY_RESOLUTION
public static final java.lang.String OPTION_BUFFER_CAPACITY
saving
or loading
the resource content.
The value must be an integer.
If not specified, DEFAULT_BUFFER_CAPACITY
is used.
A value less than one disables the cache.public static final int DEFAULT_BUFFER_CAPACITY
OPTION_BUFFER_CAPACITY
capacity of the buffered stream
used when saving
or loading
the resource content.public static final java.lang.String OPTION_INTERNAL_BUFFER_CAPACITY
BinaryResourceImpl.EObjectInputStream
or BinaryResourceImpl.EObjectOutputStream
for buffering the reading and writing of bytes.
Note that this implies that BinaryResourceImpl.EObjectInputStream
will read more bytes from the input stream than it may actually consume,
and that BinaryResourceImpl.EObjectOutputStream
will write more bytes to the byte array than have actually been produced in the output stream.
In both cases it's necessary to call flush
either to put back the unused bytes, which is only possible if the wrapped input stream supports marks
or to emit the retained bytes.
A value less then 2 disables internal buffering; the default is 0.public BinaryResourceImpl()
public BinaryResourceImpl(URI uri)
public static int getBufferCapacity(java.util.Map<?,?> options)
OPTION_BUFFER_CAPACITY
from the options.options
- a map of options.OPTION_BUFFER_CAPACITY
key in the options map.public static int getInternalBufferCapacity(java.util.Map<?,?> options)
OPTION_INTERNAL_BUFFER_CAPACITY
from the options.options
- a map of options.OPTION_INTERNAL_BUFFER_CAPACITY
key in the options map.protected void doSave(java.io.OutputStream outputStream, java.util.Map<?,?> options) throws java.io.IOException
ResourceImpl
doSave
in class ResourceImpl
outputStream
- the streamoptions
- the save options.java.io.IOException
protected BinaryResourceImpl.EObjectOutputStream createEObjectOutputStream(java.io.OutputStream outputStream, java.util.Map<?,?> options) throws java.io.IOException
java.io.IOException
protected void doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException
ResourceImpl
doLoad
in class ResourceImpl
inputStream
- the streamoptions
- the load options.java.io.IOException
protected BinaryResourceImpl.EObjectInputStream createEObjectInputStream(java.io.InputStream inputStream, java.util.Map<?,?> options) throws java.io.IOException
java.io.IOException