Package org.apache.jackrabbit.value
Class BinaryImpl
- java.lang.Object
-
- org.apache.jackrabbit.value.BinaryImpl
-
-
Constructor Summary
Constructors Constructor Description BinaryImpl(byte[] buffer)
Creates a newBinaryImpl
instance from abyte[]
array.BinaryImpl(InputStream in)
Creates a newBinaryImpl
instance from anInputStream
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
long
getSize()
InputStream
getStream()
int
read(byte[] b, long position)
-
-
-
Constructor Detail
-
BinaryImpl
public BinaryImpl(InputStream in) throws IOException
Creates a newBinaryImpl
instance from anInputStream
. The contents of the stream is spooled to a temporary file or to a byte buffer if its size is smaller thanMAX_BUFFER_SIZE
.- Parameters:
in
- stream to be represented as aBLOBFileValue
instance- Throws:
IOException
- if an error occurs while reading from the stream or writing to the temporary file
-
BinaryImpl
public BinaryImpl(byte[] buffer)
Creates a newBinaryImpl
instance from abyte[]
array.- Parameters:
buffer
- byte array to be represented as aBinaryImpl
instance
-
-
Method Detail
-
getStream
public InputStream getStream() throws RepositoryException
- Specified by:
getStream
in interfaceBinary
- Throws:
RepositoryException
-
read
public int read(byte[] b, long position) throws IOException, RepositoryException
- Specified by:
read
in interfaceBinary
- Throws:
IOException
RepositoryException
-
getSize
public long getSize() throws RepositoryException
- Specified by:
getSize
in interfaceBinary
- Throws:
RepositoryException
-
-