|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@ThreadSafe public interface BinaryFactory
A factory for creating Binary
instances. This interface extends the ValueFactory
generic interface and adds
specific methods for creating binary objects.
Field Summary |
---|
Fields inherited from interface org.modeshape.graph.property.ValueFactory |
---|
DEFAULT_DECODER, DEFAULT_ENCODER |
Method Summary | |
---|---|
Binary |
create(File file)
Create a binary value from the given file. |
Binary |
create(InputStream stream,
long approximateLength,
byte[] secureHash)
Create a value from the binary content given by the supplied stream, the approximate length, and the SHA-1 secure hash of the content. |
Binary |
create(Reader reader,
long approximateLength,
byte[] secureHash)
Create a value from the binary content given by the supplied reader, the approximate length, and the SHA-1 secure hash of the content. |
Binary |
find(byte[] secureHash)
Find an existing binary value given the supplied secure hash. |
Methods inherited from interface org.modeshape.graph.property.ValueFactory |
---|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, getPropertyType |
Method Detail |
---|
Binary create(InputStream stream, long approximateLength, byte[] secureHash) throws ValueFormatException, IoException
stream
- the stream containing the content to be used to create the valueapproximateLength
- the approximate length of the content (in bytes)secureHash
- the secure hash of the content in the stream
; if null, the secure hash is computed from the
content, and if not null it is assumed to be the correct secure hash (and is not checked)
ValueFormatException
- if the conversion from an input stream could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied stream (such as an IOException
).
IllegalArgumentException
- if the secure hash was discovered to be incorrectBinary create(Reader reader, long approximateLength, byte[] secureHash) throws ValueFormatException, IoException
reader
- the reader containing the content to be used to create the valueapproximateLength
- the approximate length of the content (in bytes)secureHash
- the secure hash of the content in the stream
; if null, the secure hash is computed from the
content, and if not null it is assumed to be the correct secure hash (and is not checked)
ValueFormatException
- if the conversion from a reader could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied reader (such as an IOException
).
IllegalArgumentException
- if the secure hash was discovered to be incorrectBinary create(File file) throws ValueFormatException, IoException
file
- the file containing the content to be used
ValueFormatException
- if the conversion from the file could not be performed
IoException
- If an unexpected problem occurs while accessing the supplied file (such as an IOException
).Binary find(byte[] secureHash)
secureHash
- the secure hash of the binary content, which was probably obtained
from a
previously-held Binary
object; a null or empty value is allowed, but will always result in returning null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |