|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.graph.properties.basic.InMemoryBinary
@Immutable public class InMemoryBinary
An implementation of Binary
that keeps the binary data in-memory.
Constructor Summary | |
---|---|
InMemoryBinary(byte[] bytes)
|
Method Summary | |
---|---|
void |
acquire()
Acquire any resources for this data. |
int |
compareTo(Binary o)
|
boolean |
equals(Object obj)
|
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. |
void |
release()
Release any acquired resources. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InMemoryBinary(byte[] bytes)
Method Detail |
---|
public long getSize()
getSize
in interface Binary
Binary.acquire()
public byte[] getHash()
Repeatedly calling this method should generally be efficient, as it most implementations will compute the hash only once.
getHash
in interface Binary
Binary.getHash()
public byte[] getBytes()
getBytes
in interface Binary
Binary.acquire()
public InputStream getStream()
getStream
in interface Binary
Binary.acquire()
public void acquire()
acquire
in interface Binary
Binary.release()
public void release()
release
in interface Binary
Binary.acquire()
public int compareTo(Binary o)
compareTo
in interface Comparable<Binary>
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |