@Override public InputStream getInput() { try { return chain.getInput(); } catch (IOException e) { propagate(e); return null; } }
@Override public InputStream getInput() { try { return chain.getInput(); } catch (IOException e) { propagate(e); return null; } }
@Override public V get(Object key) { InputSupplier<V> value = toMap.get(key); try { return value != null ? value.getInput() : null; } catch (IOException e) { throw Throwables.propagate(e); } }
@Override public V get(Object key) { InputSupplier<V> value = toMap.get(key); try { return value != null ? value.getInput() : null; } catch (IOException e) { throw Throwables.propagate(e); } }
@Override public V remove(Object key) { try { return toMap.containsKey(key) ? toMap.remove(key).getInput() : null; } catch (IOException e) { throw Throwables.propagate(e); } }
@Override public V remove(Object key) { try { return toMap.containsKey(key) ? toMap.remove(key).getInput() : null; } catch (IOException e) { throw Throwables.propagate(e); } }
/** * Closes the current reader and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { current = it.next().getInput(); } }
public ApplicationSpecification fromJson(InputSupplier<? extends Reader> inputSupplier) throws IOException { try (Reader reader = inputSupplier.getInput()) { return fromJson(reader); } }
@Override public SeekableInputStream call() throws Exception { return Locations.newInputSupplier(location).getInput(); } });
@Override public InputStream getInput() throws IOException { return decodingStream(readerSupplier.getInput()); } };
/** * Closes the current input stream and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { in = it.next().getInput(); } }
/** * Closes the current input stream and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { in = it.next().getInput(); } }
@Override public InputStream getInput() throws IOException { return decodingStream(readerSupplier.getInput()); } };
@Override public InputStream getInput() throws IOException { return decodingStream(readerSupplier.getInput()); } };
private static Reader getResourceReader(String resource) throws IOException { return Resources.newReaderSupplier(Resources.getResource(resource), Charsets.UTF_8).getInput(); } }
public static InputStream fromString(String input) { try { byte[] bytes = checkNotNull(input, "input").getBytes(Charsets.UTF_8); InputSupplier<ByteArrayInputStream> supplier = ByteStreams.newInputStreamSupplier(bytes); InputStream stream = supplier.getInput(); return stream; } catch (IOException ioe) { if (log.isDebugEnabled()) log.debug("Error creating InputStream from String: " + ioe.getMessage()); throw Exceptions.propagate(ioe); } }
@Override public Object getPayload() { // Note that while _bulk requests are made up of JSON, the body as a whole isn't actually valid JSON. final InputStream input; try { input = ByteStreams.join(Iterables.transform(actions, new PayloadFn())).getInput(); } catch (IOException e) { throw new RuntimeException(e); } return input; }
public InputStream openStream(URI uri) { try { return downloader.newInputSupplier(uri, this.readTimeout).getInput(); } catch (IOException e) { throw failToDownload(uri, e); } }
@BeforeClass(groups = { "integration", "live" }) @Override public void setUpResourcesOnThisThread(ITestContext testContext) throws Exception { super.setUpResourcesOnThisThread(testContext); oneHundredOneConstitutions = getTestDataSupplier(); oneHundredOneConstitutionsMD5 = asByteSource(oneHundredOneConstitutions.getInput()).hash(md5()).asBytes(); }
private void uploadConstitution(String container, String name, String contentDisposition) throws IOException { view.getBlobStore().putBlob( container, view.getBlobStore().blobBuilder(name).payload(oneHundredOneConstitutions.getInput()).contentType( "text/plain").contentMD5(oneHundredOneConstitutionsMD5).contentLength( oneHundredOneConstitutionsLength).contentDisposition(contentDisposition).build()); }