|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.graph.property.basic.AbstractBinary org.modeshape.graph.property.basic.InMemoryBinary
@Immutable public class InMemoryBinary
An implementation of Binary
that keeps the binary data in-memory.
Field Summary |
---|
Fields inherited from class org.modeshape.graph.property.basic.AbstractBinary |
---|
ALGORITHMS_NOT_FOUND_AND_LOGGED, EMPTY_CONTENT |
Constructor Summary | |
---|---|
InMemoryBinary(byte[] bytes)
|
Method Summary | |
---|---|
void |
acquire()
Acquire any resources for this data. |
byte[] |
getBytes()
Get the contents of this data as a byte array. |
byte[] |
getHash()
Get the SHA-1 hash of the contents. |
long |
getSize()
Get the length of this binary data. |
InputStream |
getStream()
Get the contents of this data as a stream. |
int |
hashCode()
|
void |
release()
Release any acquired resources. |
Methods inherited from class org.modeshape.graph.property.basic.AbstractBinary |
---|
compareTo, computeHash, computeHash, computeHash, equals, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InMemoryBinary(byte[] bytes)
Method Detail |
---|
public int hashCode()
hashCode
in class Object
Object.hashCode()
public long getSize()
Binary.acquire()
public byte[] getHash()
Repeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
Binary.getHash()
public byte[] getBytes()
Binary.acquire()
public InputStream getStream()
Binary.acquire()
public void acquire()
Binary.release()
public void release()
Binary.acquire()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |