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
()
| 297 | |
| 298 | |
| 299 | public byte[] read() throws IOException { |
| 300 | Closer closer = Closer.create(); |
| 301 | try { |
| 302 | InputStream in = closer.register(openStream()); |
| 303 | return ByteStreams.toByteArray(in); |
| 304 | } catch (Throwable e) { |
| 305 | throw closer.rethrow(e); |
| 306 | } finally { |
| 307 | closer.close(); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * Reads the contents of this byte source using the given {@code processor} to process bytes as |
no test coverage detected