public void readBlobTo ( String key , OutputStream out ) throws IOException , KeyNotFoundException { InputStreamWithMeta in = getBlob ( key ) ; if ( in == null ) { throw new IOException ( "Could not find " + key ) ; } byte [ ] buffer = new byte [ 2048 ] ; int len = 0 ; try { while ( ( len = in . read ( buffer ) ) > 0 ) { out . write ( buffer , 0 , len ) ; } } finally { in . close ( ) ; out . flush ( ) ; } }
Reads the blob from the blob store and writes it into the output stream .