diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/lob/CDOBlob.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/lob/CDOBlob.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/lob/CDOBlob.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/lob/CDOBlob.java new file mode 100644 index 0000000000..1a5fb21011 --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/lob/CDOBlob.java @@ -0,0 +1,54 @@ +package org.eclipse.emf.cdo.common.model.lob; + +import org.eclipse.emf.cdo.common.model.lob.CDOLobStore.Info; +import org.eclipse.emf.cdo.spi.common.model.CDOLobStoreImpl; + +import org.eclipse.net4j.util.io.ExtendedDataInput; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author Eike Stepper + * @since 4.0 + */ +public final class CDOBlob extends CDOLob<byte[], InputStream> +{ + public CDOBlob(InputStream contents) throws IOException + { + super(contents, CDOLobStoreImpl.INSTANCE); + } + + public CDOBlob(InputStream contents, CDOLobStore store) throws IOException + { + super(contents, store); + } + + CDOBlob(byte[] id, long size) + { + super(id, size); + } + + CDOBlob(ExtendedDataInput in) throws IOException + { + super(in); + } + + @Override + public byte[] toArray() throws IOException + { + return getStore().getBinaryArray(getID()); + } + + @Override + protected Info put(InputStream contents) throws IOException + { + return getStore().putBinary(contents); + } + + @Override + protected InputStream get(byte[] id) throws IOException + { + return getStore().getBinary(id); + } +} |