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)
| 105 | |
| 106 | |
| 107 | public void write(byte[] bytes) throws IOException { |
| 108 | checkNotNull(bytes); |
| 109 | Closer closer = Closer.create(); |
| 110 | try { |
| 111 | OutputStream out = closer.register(openStream()); |
| 112 | out.write(bytes); |
| 113 | out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330 |
| 114 | } catch (Throwable e) { |
| 115 | throw closer.rethrow(e); |
| 116 | } finally { |
| 117 | closer.close(); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Writes all the bytes from the given {@code InputStream} to this sink. Does not close |
nothing calls this directly
no test coverage detected