Package org.apache.jackrabbit.value
Class BinaryImpl
- java.lang.Object
-
- org.apache.jackrabbit.value.BinaryImpl
-
- All Implemented Interfaces:
javax.jcr.Binary
public class BinaryImpl extends java.lang.Object implements javax.jcr.BinaryBinaryImplimplements theBinaryinterface.
-
-
Constructor Summary
Constructors Constructor Description BinaryImpl(byte[] buffer)Creates a newBinaryImplinstance from abyte[]array.BinaryImpl(java.io.InputStream in)Creates a newBinaryImplinstance from anInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()longgetSize()java.io.InputStreamgetStream()intread(byte[] b, long position)
-
-
-
Constructor Detail
-
BinaryImpl
public BinaryImpl(java.io.InputStream in) throws java.io.IOExceptionCreates a newBinaryImplinstance 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 aBLOBFileValueinstance- Throws:
java.io.IOException- if an error occurs while reading from the stream or writing to the temporary file
-
BinaryImpl
public BinaryImpl(byte[] buffer)
Creates a newBinaryImplinstance from abyte[]array.- Parameters:
buffer- byte array to be represented as aBinaryImplinstance
-
-
Method Detail
-
getStream
public java.io.InputStream getStream() throws javax.jcr.RepositoryException- Specified by:
getStreamin interfacejavax.jcr.Binary- Throws:
javax.jcr.RepositoryException
-
read
public int read(byte[] b, long position) throws java.io.IOException, javax.jcr.RepositoryException- Specified by:
readin interfacejavax.jcr.Binary- Throws:
java.io.IOExceptionjavax.jcr.RepositoryException
-
getSize
public long getSize() throws javax.jcr.RepositoryException- Specified by:
getSizein interfacejavax.jcr.Binary- Throws:
javax.jcr.RepositoryException
-
dispose
public void dispose()
- Specified by:
disposein interfacejavax.jcr.Binary
-
-