/** * Prepares the stream for read. Must be called before any read operation is executed. * * @throws IOException * if preparation fails due to inability to obtain defined number of byte buffers */ @Override public void prepare() throws IOException { super.prepare(); // set total size long totalSize = 0; for (IStorageDescriptor descriptor : descriptors) { totalSize += descriptor.getSize(); } setTotalSize(totalSize); executorService.execute(new ReadTask()); }