Reads the full contents of this byte source as a byte array. @throws IOException if an I/O error occurs in the process of reading from this source
()
| 281 | * @throws IOException if an I/O error occurs in the process of reading from this source |
| 282 | */ |
| 283 | public byte[] read() throws IOException { |
| 284 | Closer closer = Closer.create(); |
| 285 | try { |
| 286 | InputStream in = closer.register(openStream()); |
| 287 | return ByteStreams.toByteArray(in); |
| 288 | } catch (Throwable e) { |
| 289 | throw closer.rethrow(e); |
| 290 | } finally { |
| 291 | closer.close(); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Reads the contents of this byte source using the given {@code processor} to process bytes as |
no test coverage detected