Class ByteChunkProvider

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static int CHUNK_SIZE  
      protected int chunkSize  
      protected long offset  
    • Method Summary

      Modifier and Type Method Description
      abstract int bytesLeft()  
      void close()  
      protected abstract int getChunk​(byte[] chunk)  
      int getChunkSize()  
      int getLastWriteSize()  
      long getOffset()  
      abstract boolean isAvailable()  
      abstract void prepareWrite​(int maxBytesToPrepare)  
      void writeChunk​(Buffer<?> buffer)  
      void writeChunk​(java.io.OutputStream os)  
      void writeChunks​(Buffer<?> buffer, int nrChunks)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • offset

        protected long offset
      • chunkSize

        protected int chunkSize
    • Constructor Detail

      • ByteChunkProvider

        public ByteChunkProvider()
    • Method Detail

      • isAvailable

        public abstract boolean isAvailable()
      • prepareWrite

        public abstract void prepareWrite​(int maxBytesToPrepare)
      • writeChunk

        public void writeChunk​(java.io.OutputStream os)
      • writeChunks

        public void writeChunks​(Buffer<?> buffer,
                                int nrChunks)
      • writeChunk

        public void writeChunk​(Buffer<?> buffer)
      • getChunkSize

        public int getChunkSize()
      • getOffset

        public long getOffset()
      • getLastWriteSize

        public int getLastWriteSize()
      • getChunk

        protected abstract int getChunk​(byte[] chunk)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • bytesLeft

        public abstract int bytesLeft()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException