public void downloadTo ( Path path , BlobSourceOption ... options ) { try ( OutputStream outputStream = Files . newOutputStream ( path ) ; ReadChannel reader = reader ( options ) ) { WritableByteChannel channel = Channels . newChannel ( outputStream ) ; ByteBuffer bytes = ByteBuffer . allocate ( DEFAULT_CHUNK_SIZE ) ; while ( reader . read ( bytes ) > 0 ) { bytes . flip ( ) ; channel . write ( bytes ) ; bytes . clear ( ) ; } } catch ( IOException e ) { throw new StorageException ( e ) ; } }
Downloads this blob to the given file path using specified blob read options .