org.apache.jackrabbit.core.value
Class BLOBInMemory

java.lang.Object
  extended by org.apache.jackrabbit.core.value.BLOBFileValue
      extended by org.apache.jackrabbit.core.value.BLOBInMemory

public class BLOBInMemory
extends BLOBFileValue

Represents binary data which is backed by a byte[] (in memory).


Method Summary
 void delete(boolean pruneEmptyParentDirs)
          Deletes the persistent resource backing this BLOBFileValue.
 void discard()
          Frees temporarily allocated resources such as temporary file, buffer, etc.
 boolean equals(Object obj)
          
 long getLength()
          Returns the length of this BLOBFileValue.
 InputStream getStream()
          Returns an InputStream representation of this value.
 int hashCode()
          Returns zero to satisfy the Object equals/hashCode contract.
 String toString()
          
 
Methods inherited from class org.apache.jackrabbit.core.value.BLOBFileValue
spool
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

delete

public void delete(boolean pruneEmptyParentDirs)
Deletes the persistent resource backing this BLOBFileValue.

Specified by:
delete in class BLOBFileValue
Parameters:
pruneEmptyParentDirs - if true, empty parent directories will automatically be deleted

discard

public void discard()
Frees temporarily allocated resources such as temporary file, buffer, etc. If this BLOBFileValue is backed by a persistent resource calling this method will have no effect.

Specified by:
discard in class BLOBFileValue
See Also:
#delete(), BLOBFileValue.delete(boolean)

getLength

public long getLength()
Returns the length of this BLOBFileValue.

Specified by:
getLength in class BLOBFileValue
Returns:
The length, in bytes, of this BLOBFileValue, or -1L if the length can't be determined.

getStream

public InputStream getStream()
Returns an InputStream representation of this value.

Specified by:
getStream in class BLOBFileValue
Returns:
An InputStream representation of this value.

toString

public String toString()

Specified by:
toString in class BLOBFileValue

equals

public boolean equals(Object obj)

Specified by:
equals in class BLOBFileValue

hashCode

public int hashCode()
Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.

Specified by:
hashCode in class BLOBFileValue
Returns:
always zero
See Also:
Object.hashCode()


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.