Writes all the given bytes to this sink. @throws IOException if an I/O occurs in the process of writing to this sink
(byte[] bytes)
| 96 | * @throws IOException if an I/O occurs in the process of writing to this sink |
| 97 | */ |
| 98 | public void write(byte[] bytes) throws IOException { |
| 99 | checkNotNull(bytes); |
| 100 | |
| 101 | Closer closer = Closer.create(); |
| 102 | try { |
| 103 | OutputStream out = closer.register(openStream()); |
| 104 | out.write(bytes); |
| 105 | out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330 |
| 106 | } catch (Throwable e) { |
| 107 | throw closer.rethrow(e); |
| 108 | } finally { |
| 109 | closer.close(); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Writes all the bytes from the given {@code InputStream} to this sink. Does not close |
nothing calls this directly
no test coverage detected