|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nci.caarray.domain.MultiPartBlob
public class MultiPartBlob
This class is used to get around a mysql issue where the mysql server uses memory extremely poorly on a connection where a blob is being used. In order to get around this memory issue we are breaking a single blob up in to many smaller blobs.
Constructor Summary | |
---|---|
MultiPartBlob()
|
Method Summary | |
---|---|
void |
addBlob(java.sql.Blob blob)
Add a blob part. |
java.util.List<BlobHolder> |
getBlobParts()
The blobParts as stored by hibernate. |
long |
getCompressedSize()
|
java.util.Date |
getCreationTimestamp()
|
java.lang.Long |
getId()
Returns the id. |
long |
getUncompressedSize()
|
java.io.InputStream |
readCompressedContents()
Returns an input stream to access the contents of this MultiPartBlob. |
java.io.InputStream |
readUncompressedContents()
Returns an input stream to access the contents of this MultiPartBlob. |
void |
setCompressedSize(long compressedSize)
This method should generally not be called directly, as file size is calculated when data is written to the file. |
void |
setCreationTimestamp(java.util.Date timestamp)
|
void |
setId(java.lang.Long id)
Deprecated. should only be used by castor and hibernate |
void |
setUncompressedSize(long uncompressedSize)
This method should generally not be called directly, as file size is calculated when data is written to the file. |
void |
writeData(java.io.InputStream data,
boolean compress,
int blobPartSize)
Method that takes an input stream and breaks it up in to multiple blobs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiPartBlob()
Method Detail |
---|
public java.lang.Long getId()
getId
in interface com.fiveamsolutions.nci.commons.data.persistent.PersistentObject
@Deprecated public void setId(java.lang.Long id)
id
- the id to setpublic java.util.List<BlobHolder> getBlobParts()
public void writeData(java.io.InputStream data, boolean compress, int blobPartSize) throws java.io.IOException
data
- the input stream to store.compress
- true to compress the data, false to leave it uncompressedblobPartSize
- the maximum size of a single blob
java.io.IOException
- on error reading from the stream.public void addBlob(java.sql.Blob blob)
blob
- blob datapublic java.io.InputStream readCompressedContents() throws java.io.IOException
java.io.IOException
- if the contents couldn't be accessed.public java.io.InputStream readUncompressedContents() throws java.io.IOException
java.io.IOException
- if the contents couldn't be accessed.@NotNull public java.util.Date getCreationTimestamp()
public void setCreationTimestamp(java.util.Date timestamp)
timestamp
- the timestamp to setpublic long getUncompressedSize()
public void setUncompressedSize(long uncompressedSize)
uncompressedSize
- the uncompressed size of the file, in bytespublic long getCompressedSize()
public void setCompressedSize(long compressedSize)
compressedSize
- the compressed size of the file, in bytes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |