Package org.docx4j.utils
Class BufferUtil
java.lang.Object
org.docx4j.utils.BufferUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBuffercreateByteBuffer(int capacity) static byte[]static InputStreamnewInputStream(ByteBuffer buf) Returns an input stream for a ByteBuffer.static ByteBufferFully reads the given InputStream, returning its contents as a ByteBuffer
-
Constructor Details
-
BufferUtil
public BufferUtil()
-
-
Method Details
-
readInputStream
Fully reads the given InputStream, returning its contents as a ByteBuffer- Parameters:
in- anInputStreamvalue- Returns:
- a
ByteBuffervalue - Throws:
IOException- if an error occurs
-
createByteBuffer
-
newInputStream
Returns an input stream for a ByteBuffer. The read() methods use the relative ByteBuffer get() methods. -
getBytesFromInputStream
- Throws:
IOException
-