Class ByteArrayBackedDataSource


  • public class ByteArrayBackedDataSource
    extends DataSource
    A POIFS DataSource backed by a byte array.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the underlying stream
      void copyTo​(java.io.OutputStream stream)
      Copies the contents to the specified OutputStream
      java.nio.ByteBuffer read​(int length, long position)  
      long size()  
      void write​(java.nio.ByteBuffer src, long position)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteArrayBackedDataSource

        public ByteArrayBackedDataSource​(byte[] data,
                                         int size)
      • ByteArrayBackedDataSource

        public ByteArrayBackedDataSource​(byte[] data)
    • Method Detail

      • read

        public java.nio.ByteBuffer read​(int length,
                                        long position)
        Specified by:
        read in class DataSource
      • write

        public void write​(java.nio.ByteBuffer src,
                          long position)
        Specified by:
        write in class DataSource
      • copyTo

        public void copyTo​(java.io.OutputStream stream)
                    throws java.io.IOException
        Description copied from class: DataSource
        Copies the contents to the specified OutputStream
        Specified by:
        copyTo in class DataSource
        Throws:
        java.io.IOException
      • close

        public void close()
        Description copied from class: DataSource
        Close the underlying stream
        Specified by:
        close in class DataSource