Package com.db4o.internal
Class BlobImpl
- java.lang.Object
- 
- com.db4o.internal.BlobImpl
 
- 
- All Implemented Interfaces:
- Db4oTypeImpl,- TransactionAware,- Blob,- Db4oType,- java.lang.Cloneable
 
 public class BlobImpl extends java.lang.Object implements Blob, java.lang.Cloneable, Db4oTypeImpl Transfer of blobs to and from the db4o system, if users use the Blob Db4oType.
- 
- 
Field SummaryFields Modifier and Type Field Description static intCOPYBUFFER_LENGTHjava.lang.StringfileNamejava.lang.Stringi_extinti_length
 - 
Constructor SummaryConstructors Constructor Description BlobImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intadjustReadDepth(int depth)java.lang.ObjectcreateDefault(Transaction a_trans)voiddeleteFile()Deletes the current file stored in this BLOB.java.io.FileInputStreamgetClientInputStream()java.io.FileOutputStreamgetClientOutputStream()java.lang.StringgetFileName()returns the name of the file the blob was stored to.intgetLength()doublegetStatus()returns the status after the last read- or write-operation.voidgetStatusFrom(BlobStatus from)booleanhasClassIndex()voidreadFrom(java.io.File file)reads a file into the db4o system and stores it as a blob.voidreadLocal(java.io.File file)reads a file into the db4o system and stores it as a blob.java.io.FileserverFile(java.lang.String promptName, boolean writeToServer)voidsetObjectReference(ObjectReference objectReference)voidsetStatus(double status)voidsetTrans(Transaction a_trans)voidwriteLocal(java.io.File file)writes stored blob data to a file.voidwriteTo(java.io.File file)writes stored blob data to a file.
 
- 
- 
- 
Field Detail- 
COPYBUFFER_LENGTHpublic static final int COPYBUFFER_LENGTH - See Also:
- Constant Field Values
 
 - 
fileNamepublic java.lang.String fileName 
 - 
i_extpublic java.lang.String i_ext 
 - 
i_lengthpublic int i_length 
 
- 
 - 
Method Detail- 
adjustReadDepthpublic int adjustReadDepth(int depth) - Parameters:
- depth-
 
 - 
createDefaultpublic java.lang.Object createDefault(Transaction a_trans) - Specified by:
- createDefaultin interface- Db4oTypeImpl
 
 - 
getClientInputStreampublic java.io.FileInputStream getClientInputStream() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
getClientOutputStreampublic java.io.FileOutputStream getClientOutputStream() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
getFileNamepublic java.lang.String getFileName() Description copied from interface:Blobreturns the name of the file the blob was stored to.
 The method may return null, if the file was never stored.- Specified by:
- getFileNamein interface- Blob
- Returns:
- String the name of the file.
 
 - 
getLengthpublic int getLength() 
 - 
getStatuspublic double getStatus() Description copied from interface:Blobreturns the status after the last read- or write-operation.
 The status value returned may be any of the following:
 Status.UNUSEDno data was ever stored to the Blob field.
 Status.AVAILABLEavailable data was previously stored to the Blob field.
 Status.QUEUEDan operation was triggered and is waiting for it's turn in the Blob queue.
 Status.COMPLETEDthe last operation on this field was completed successfully.
 Status.PROCESSINGfor internal use only.
 Status.ERRORthe last operation failed.
 or a double between 0 and 1 that signifies the current completion percentage of the currently running operation.
 the fiveStatusconstants defined in this interface or a double between 0 and 1 that signifies the completion of the currently running operation.
 - 
getStatusFrompublic void getStatusFrom(BlobStatus from) 
 - 
hasClassIndexpublic boolean hasClassIndex() - Specified by:
- hasClassIndexin interface- Db4oTypeImpl
 
 - 
readFrompublic void readFrom(java.io.File file) throws java.io.IOExceptionDescription copied from interface:Blobreads a file into the db4o system and stores it as a blob.
 In Client/Server mode db4o will open an additional socket and process writing data in an additional thread.
 - 
readLocalpublic void readLocal(java.io.File file) throws java.io.IOExceptionDescription copied from interface:Blobreads a file into the db4o system and stores it as a blob.
 db4o will use the local file system in Client/Server mode also.
 - 
serverFilepublic java.io.File serverFile(java.lang.String promptName, boolean writeToServer) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
setStatuspublic void setStatus(double status) 
 - 
setTranspublic void setTrans(Transaction a_trans) - Specified by:
- setTransin interface- TransactionAware
 
 - 
writeLocalpublic void writeLocal(java.io.File file) throws java.io.IOExceptionDescription copied from interface:Blobwrites stored blob data to a file.
 db4o will use the local file system in Client/Server mode also.- Specified by:
- writeLocalin interface- Blob
- Parameters:
- file- the file the blob is to be written to.
- Throws:
- java.io.IOException- in case of errors and in case no blob data was stored
 
 - 
writeTopublic void writeTo(java.io.File file) throws java.io.IOExceptionDescription copied from interface:Blobwrites stored blob data to a file.
 In Client/Server mode db4o will open an additional socket and process writing data in an additional thread.
 - 
setObjectReferencepublic void setObjectReference(ObjectReference objectReference) - Specified by:
- setObjectReferencein interface- Db4oTypeImpl
 
 - 
deleteFilepublic void deleteFile() throws java.io.IOExceptionDescription copied from interface:BlobDeletes the current file stored in this BLOB.- Specified by:
- deleteFilein interface- Blob
- Throws:
- java.io.IOException- in case of errors and in case no data was stored
 
 
- 
 
-