public void write ( byte [ ] bytes ) throws IOException { checkNotNull ( bytes ) ; Closer closer = Closer . create ( ) ; try { OutputStream out = closer . register ( openStream ( ) ) ; out . write ( bytes ) ; out . flush ( ) ; // https://code.google.com/p/guava-libraries/issues/detail?id=1330 } catch ( Throwable e ) { throw closer . rethrow ( e ) ; } finally { closer . close ( ) ; } }
Writes all the given bytes to this sink .