Opens a new buffered {@link InputStream} for reading from this source. The returned stream is not required to be a {@link BufferedInputStream} in order to allow implementations to simply delegate to {@link #openStream()} when the stream returned by that method does not benefit from additional buffer
()
| 116 | * @since 15.0 (in 14.0 with return type {@link BufferedInputStream}) |
| 117 | */ |
| 118 | public InputStream openBufferedStream() throws IOException { |
| 119 | InputStream in = openStream(); |
| 120 | return (in instanceof BufferedInputStream) |
| 121 | ? (BufferedInputStream) in |
| 122 | : new BufferedInputStream(in); |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Returns a view of a slice of this byte source that is at most {@code length} bytes long |
no test coverage detected