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 newBinaryImplinstance from abyte[]array.BinaryImpl(InputStream in)Creates a newBinaryImplinstance from anInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()longgetSize()InputStreamgetStream()intread(byte[] b, long position)
-
-
-
Constructor Detail
-
BinaryImpl
public BinaryImpl(InputStream in) throws IOException
Creates 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:
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 InputStream getStream() throws RepositoryException
- Specified by:
getStreamin interfaceBinary- Throws:
RepositoryException
-
read
public int read(byte[] b, long position) throws IOException, RepositoryException- Specified by:
readin interfaceBinary- Throws:
IOExceptionRepositoryException
-
getSize
public long getSize() throws RepositoryException- Specified by:
getSizein interfaceBinary- Throws:
RepositoryException
-
-