Copyright© 2008-2018 SiteVision AB, all rights reserved.
public interface Binary
Binary
object holds a JCR property value of type
BINARY
. The Binary
interface and the related
methods in Property
, Value
and ValueFactory
replace
the deprecated Value.getStream()
and Property.getStream()
methods.Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases all resources associated with this
Binary object
and informs the repository that these resources may now be reclaimed. |
long |
getSize()
Returns the size of this
Binary value in bytes. |
java.io.InputStream |
getStream()
Returns an
InputStream representation of this value. |
int |
read(byte[] b,
long position)
Reads successive bytes from the specified
position in this
Binary into the passed byte array until either the byte
array is full or the end of the Binary is encountered. |
java.io.InputStream getStream() throws RepositoryException
InputStream
representation of this value. Each call to
getStream()
returns a new stream. The API consumer is
responsible for calling close()
on the returned stream.
If dispose()
has been called on this Binary
object, then this method will throw the runtime exception
IllegalStateException
.
RepositoryException
- if an error occurs.int read(byte[] b, long position) throws java.io.IOException, RepositoryException
position
in this
Binary
into the passed byte array until either the byte
array is full or the end of the Binary
is encountered.
If dispose()
has been called on this Binary
object, then this method will throw the runtime exception
IllegalStateException
.
SiteVision note: Unsupported operation
b
- the buffer into which the data is read.position
- the position in this Binary from which to start reading
bytes.java.io.IOException
- if an I/O error occurs.NullPointerException
- if b is null.IllegalArgumentException
- if offset is negative.RepositoryException
- if another error occurs.long getSize() throws RepositoryException
Binary
value in bytes.
If dispose()
has been called on this Binary
object, then this method will throw the runtime exception
IllegalStateException
.
RepositoryException
- if an error occurs.void dispose()
Binary
object
and informs the repository that these resources may now be reclaimed.
An application should call this method when it is finished with the
Binary
object.SiteVision - Portal and Content Management Made Easy
SiteVision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2018 SiteVision AB, all rights reserved.