Class BufferUtil

java.lang.Object
org.docx4j.utils.BufferUtil

public class BufferUtil extends Object
  • Constructor Details

    • BufferUtil

      public BufferUtil()
  • Method Details

    • readInputStream

      public static ByteBuffer readInputStream(InputStream in) throws IOException
      Fully reads the given InputStream, returning its contents as a ByteBuffer
      Parameters:
      in - an InputStream value
      Returns:
      a ByteBuffer value
      Throws:
      IOException - if an error occurs
    • createByteBuffer

      public static ByteBuffer createByteBuffer(int capacity)
    • newInputStream

      public static InputStream newInputStream(ByteBuffer buf)
      Returns an input stream for a ByteBuffer. The read() methods use the relative ByteBuffer get() methods.
    • getBytesFromInputStream

      public static byte[] getBytesFromInputStream(InputStream is) throws IOException
      Throws:
      IOException