org.loom.persistence.file
Class ByteArrayPersistentFileContents

java.lang.Object
  extended by org.loom.persistence.file.DatabaseFileContents
      extended by org.loom.persistence.file.ByteArrayPersistentFileContents
All Implemented Interfaces:
PersistentFileContents

public class ByteArrayPersistentFileContents
extends DatabaseFileContents

Extends PersistentFile with its data as a byte[]


Constructor Summary
ByteArrayPersistentFileContents()
           
 
Method Summary
 byte[] getContentsAsBytes()
           
 java.io.InputStream getContentsAsStream()
           
 java.lang.Long getFileSize()
           
 void setContentsAsBytes(byte[] contents)
           
 
Methods inherited from class org.loom.persistence.file.DatabaseFileContents
getFile, getId, setFile, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayPersistentFileContents

public ByteArrayPersistentFileContents()
Method Detail

getContentsAsBytes

public byte[] getContentsAsBytes()

setContentsAsBytes

public void setContentsAsBytes(byte[] contents)

getContentsAsStream

public java.io.InputStream getContentsAsStream()
Returns:
the file contents as an InputStream

getFileSize

public java.lang.Long getFileSize()
Returns:
the file size if known, null if cannot be calculated from the file contents (it must be handled elsewhere in that case).