@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
@Override @GwtIncompatible // Reader,InputStream public InputStream decodingStream(final Reader reader) { return delegate.decodingStream(ignoringReader(reader, separator)); }
@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
@Override @GwtIncompatible // Reader,InputStream public InputStream decodingStream(final Reader reader) { return delegate.decodingStream(ignoringReader(reader, separator)); }
@GwtIncompatible // Reader private static void testStreamingDecodes(BaseEncoding encoding, String encoded, String decoded) throws IOException { byte[] bytes = decoded.getBytes(UTF_8); InputStream decodingStream = encoding.decodingStream(new StringReader(encoded)); for (int i = 0; i < bytes.length; i++) { assertThat(decodingStream.read()).isEqualTo(bytes[i] & 0xFF); } assertThat(decodingStream.read()).isEqualTo(-1); decodingStream.close(); }
@Override @GwtIncompatible // Reader,InputStream public InputStream decodingStream(final Reader reader) { return delegate.decodingStream(ignoringReader(reader, separator)); }
@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
static long countBase64EncodedBytes(String base64) { long len; try (StringReader reader = new StringReader(base64)) { len = ByteStreams.copy(BaseEncoding.base64().decodingStream(reader), ByteStreams.nullOutputStream()); } catch (IOException e) { throw new AssertionError("IOException shouldn't be thrown by memory-only input streams"); } return len; } }
@Override public InputStream getInput() throws IOException { return decodingStream(readerSupplier.getInput()); } };
@Override public InputStream getInput() throws IOException { return decodingStream(readerSupplier.getInput()); } };
@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
@Override public InputStream getInput() throws IOException { return decodingStream(readerSupplier.getInput()); } };
@Override public InputStream openStream() throws IOException { return decodingStream(encodedSource.openStream()); } };
@Override @GwtIncompatible // Reader,InputStream public InputStream decodingStream(final Reader reader) { return delegate.decodingStream(ignoringReader(reader, separator)); }
@Override @GwtIncompatible // Reader,InputStream public InputStream decodingStream(final Reader reader) { return delegate.decodingStream(ignoringReader(reader, separator)); }
/** * Returns an {@code InputStream} that decodes base-encoded input from the specified * {@code Reader}. The returned stream throws a {@link DecodingException} upon decoding-specific * errors. */ @GwtIncompatible("Reader,InputStream") public final InputStream decodingStream(Reader reader) { return asInputStream(decodingStream(asCharInput(reader))); }
/** * Returns an {@code InputStream} that decodes base-encoded input from the specified * {@code Reader}. */ @GwtIncompatible("Reader,InputStream") public final InputStream decodingStream(Reader reader) { return asInputStream(decodingStream(asCharInput(reader))); }
/** * Returns an {@code InputStream} that decodes base-encoded input from the specified * {@code Reader}. The returned stream throws a {@link DecodingException} upon decoding-specific * errors. */ @GwtIncompatible("Reader,InputStream") public final InputStream decodingStream(Reader reader) { return asInputStream(decodingStream(asCharInput(reader))); }