Home
last modified time | relevance | path

Searched refs:ByteSource (Results 1 – 25 of 52) sorted by relevance

123

/external/guava/android/guava-tests/test/com/google/common/io/
DByteSourceTest.java175 ByteSource byteSource = new TestByteSource("hamburger\n".getBytes(Charsets.US_ASCII)); in testHash()
185 ByteSource equalSource = new TestByteSource(bytes); in testContentEquals()
189 ByteSource fewerBytes = new TestByteSource(newPreFilledByteArray(bytes.length / 2)); in testContentEquals()
194 ByteSource oneByteOff = new TestByteSource(copy); in testContentEquals()
237 ByteSource slice = source.slice(10, 5); in testSlice_appendingAfterSlicing()
252 private static class AppendableByteSource extends ByteSource {
305 ByteSource source = new TestByteSource(newPreFilledByteArray(input)); in assertCorrectSlice()
306 ByteSource slice = source.slice(offset, length); in assertCorrectSlice()
356 ByteSource b1 = ByteSource.wrap(new byte[] {0, 1, 2, 3}); in testConcat()
357 ByteSource b2 = ByteSource.wrap(new byte[0]); in testConcat()
[all …]
DMultiInputStreamTest.java48 final ByteSource source = newByteSource(0, 50); in testOnlyOneOpen()
50 ByteSource checker = in testOnlyOneOpen()
51 new ByteSource() { in testOnlyOneOpen()
66 byte[] result = ByteSource.concat(checker, checker, checker).read(); in testOnlyOneOpen()
71 List<ByteSource> sources = Lists.newArrayList(); in joinHelper()
77 ByteSource joined = ByteSource.concat(sources); in joinHelper()
82 ByteSource source = newByteSource(0, 10); in testReadSingleByte()
83 ByteSource joined = ByteSource.concat(source, source); in testReadSingleByte()
101 new ByteSource() { in testSkip()
133 return new MultiInputStream(Collections.nCopies(10_000_000, ByteSource.empty()).iterator()); in tenMillionEmptySources()
[all …]
DSourceSinkFactories.java105 public ByteSource createSource(byte[] data) throws IOException { in asByteSourceFactory()
176 public ByteSource createSource(byte[] bytes) throws IOException {
214 public ByteSource createSource(byte[] bytes) throws IOException {
215 return ByteSource.wrap(bytes);
246 public ByteSource createSource(byte[] bytes) throws IOException {
247 return ByteSource.empty();
286 public ByteSource createSource(byte[] bytes) throws IOException {
422 public ByteSource createSource(byte[] bytes) throws IOException {
DFileBackedOutputStreamTest.java48 ByteSource source = out.asByteSource(); in testThreshold()
55 assertTrue(ByteSource.wrap(data).slice(0, chunk1).contentEquals(source)); in testThreshold()
130 ByteSource source = out.asByteSource(); in testWriteErrorAfterClose()
150 ByteSource source = out.asByteSource(); in testReset()
DByteSourceTester.java47 public class ByteSourceTester extends SourceSinkTester<ByteSource, byte[], ByteSourceFactory> {
112 private ByteSource source;
186 new ByteSource() { in testContentEquals()
239 ByteSource sliced = source.slice(1, size - 2); in testSlice_constrainedRange()
241 ByteSource resliced = sliced.slice(0, size - 1); in testSlice_constrainedRange()
/external/guava/guava-tests/test/com/google/common/io/
DByteSourceTest.java175 ByteSource byteSource = new TestByteSource("hamburger\n".getBytes(Charsets.US_ASCII)); in testHash()
185 ByteSource equalSource = new TestByteSource(bytes); in testContentEquals()
189 ByteSource fewerBytes = new TestByteSource(newPreFilledByteArray(bytes.length / 2)); in testContentEquals()
194 ByteSource oneByteOff = new TestByteSource(copy); in testContentEquals()
237 ByteSource slice = source.slice(10, 5); in testSlice_appendingAfterSlicing()
252 private static class AppendableByteSource extends ByteSource {
305 ByteSource source = new TestByteSource(newPreFilledByteArray(input)); in assertCorrectSlice()
306 ByteSource slice = source.slice(offset, length); in assertCorrectSlice()
356 ByteSource b1 = ByteSource.wrap(new byte[] {0, 1, 2, 3}); in testConcat()
357 ByteSource b2 = ByteSource.wrap(new byte[0]); in testConcat()
[all …]
DMultiInputStreamTest.java48 final ByteSource source = newByteSource(0, 50); in testOnlyOneOpen()
50 ByteSource checker = in testOnlyOneOpen()
51 new ByteSource() { in testOnlyOneOpen()
66 byte[] result = ByteSource.concat(checker, checker, checker).read(); in testOnlyOneOpen()
71 List<ByteSource> sources = Lists.newArrayList(); in joinHelper()
77 ByteSource joined = ByteSource.concat(sources); in joinHelper()
82 ByteSource source = newByteSource(0, 10); in testReadSingleByte()
83 ByteSource joined = ByteSource.concat(source, source); in testReadSingleByte()
101 new ByteSource() { in testSkip()
133 return new MultiInputStream(Collections.nCopies(10_000_000, ByteSource.empty()).iterator()); in tenMillionEmptySources()
[all …]
DFileBackedOutputStreamTest.java48 ByteSource source = out.asByteSource(); in testThreshold()
55 assertTrue(ByteSource.wrap(data).slice(0, chunk1).contentEquals(source)); in testThreshold()
130 ByteSource source = out.asByteSource(); in testWriteErrorAfterClose()
150 ByteSource source = out.asByteSource(); in testReset()
DByteSourceTester.java47 public class ByteSourceTester extends SourceSinkTester<ByteSource, byte[], ByteSourceFactory> {
112 private ByteSource source;
186 new ByteSource() { in testContentEquals()
239 ByteSource sliced = source.slice(1, size - 2); in testSlice_constrainedRange()
241 ByteSource resliced = sliced.slice(0, size - 1); in testSlice_constrainedRange()
DSourceSinkFactories.java140 public ByteSource createSource(byte[] data) throws IOException { in asByteSourceFactory()
211 public ByteSource createSource(byte[] bytes) throws IOException {
249 public ByteSource createSource(byte[] bytes) throws IOException {
250 return ByteSource.wrap(bytes);
281 public ByteSource createSource(byte[] bytes) throws IOException {
282 return ByteSource.empty();
321 public ByteSource createSource(byte[] bytes) throws IOException {
457 public ByteSource createSource(byte[] bytes) throws IOException {
504 public ByteSource createSource(byte[] bytes) throws IOException {
/external/guava/android/guava/src/com/google/common/io/
DByteSource.java64 public abstract class ByteSource { class
67 protected ByteSource() {} in ByteSource() method in ByteSource
120 public ByteSource slice(long offset, long length) { in slice()
336 public boolean contentEquals(ByteSource other) throws IOException { in contentEquals()
373 public static ByteSource concat(Iterable<? extends ByteSource> sources) { in concat()
395 public static ByteSource concat(Iterator<? extends ByteSource> sources) { in concat()
411 public static ByteSource concat(ByteSource... sources) { in concat()
426 public static ByteSource wrap(byte[] b) { in wrap()
435 public static ByteSource empty() { in empty()
451 public ByteSource asByteSource(Charset charset) { in asByteSource()
[all …]
DFileBackedOutputStream.java56 private final ByteSource source;
118 new ByteSource() { in FileBackedOutputStream()
135 new ByteSource() { in FileBackedOutputStream()
149 public ByteSource asByteSource() { in asByteSource()
DMultiInputStream.java35 private Iterator<? extends ByteSource> it;
43 public MultiInputStream(Iterator<? extends ByteSource> it) throws IOException { in MultiInputStream()
DResources.java55 public static ByteSource asByteSource(URL url) { in asByteSource()
60 private static final class UrlByteSource extends ByteSource {
/external/guava/guava/src/com/google/common/io/
DByteSource.java64 public abstract class ByteSource { class
67 protected ByteSource() {} in ByteSource() method in ByteSource
120 public ByteSource slice(long offset, long length) { in slice()
336 public boolean contentEquals(ByteSource other) throws IOException { in contentEquals()
373 public static ByteSource concat(Iterable<? extends ByteSource> sources) { in concat()
395 public static ByteSource concat(Iterator<? extends ByteSource> sources) { in concat()
411 public static ByteSource concat(ByteSource... sources) { in concat()
426 public static ByteSource wrap(byte[] b) { in wrap()
435 public static ByteSource empty() { in empty()
451 public ByteSource asByteSource(Charset charset) { in asByteSource()
[all …]
DFileBackedOutputStream.java56 private final ByteSource source;
117 new ByteSource() { in FileBackedOutputStream()
134 new ByteSource() { in FileBackedOutputStream()
148 public ByteSource asByteSource() { in asByteSource()
DMultiInputStream.java35 private Iterator<? extends ByteSource> it;
43 public MultiInputStream(Iterator<? extends ByteSource> it) throws IOException { in MultiInputStream()
DResources.java55 public static ByteSource asByteSource(URL url) { in asByteSource()
60 private static final class UrlByteSource extends ByteSource {
/external/protobuf/src/google/protobuf/stubs/
Dbytestream.h107 class PROTOBUF_EXPORT ByteSource {
109 ByteSource() {} in ByteSource() function
110 virtual ~ByteSource() {} in ~ByteSource()
145 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ByteSource);
296 class PROTOBUF_EXPORT ArrayByteSource : public ByteSource {
327 class PROTOBUF_EXPORT LimitByteSource : public ByteSource {
330 LimitByteSource(ByteSource* source, size_t limit);
341 ByteSource* source_;
Dbytestream.cc42 void ByteSource::CopyTo(ByteSink* sink, size_t n) { in CopyTo()
161 LimitByteSource::LimitByteSource(ByteSource *source, size_t limit) in LimitByteSource()
/external/guava/android/guava-tests/benchmark/com/google/common/io/
DByteSourceAsCharSourceReadBenchmark.java36 String read(ByteSource byteSource, Charset cs) throws IOException { in read()
42 String read(ByteSource byteSource, Charset cs) throws IOException { in read()
57 String read(ByteSource byteSource, Charset cs) throws IOException { in read()
97 abstract String read(ByteSource byteSource, Charset cs) throws IOException; in read()
109 ByteSource data;
123 data = ByteSource.wrap(string.getBytes(charset)); in setUp()
130 final ByteSource localData = data; in timeCopy()
/external/guava/guava-tests/benchmark/com/google/common/io/
DByteSourceAsCharSourceReadBenchmark.java36 String read(ByteSource byteSource, Charset cs) throws IOException { in read()
42 String read(ByteSource byteSource, Charset cs) throws IOException { in read()
57 String read(ByteSource byteSource, Charset cs) throws IOException { in read()
97 abstract String read(ByteSource byteSource, Charset cs) throws IOException; in read()
109 ByteSource data;
123 data = ByteSource.wrap(string.getBytes(charset)); in setUp()
130 final ByteSource localData = data; in timeCopy()
/external/caliper/caliper/src/main/java/com/google/caliper/config/
DCaliperConfigLoader.java25 import com.google.common.io.ByteSource;
67 ByteSource supplier = Util.resourceSupplier(CaliperConfig.class, "default-config.properties"); in loadOrCreate()
89 private static void tryCopyIfNeeded(ByteSource supplier, File rcFile) { in tryCopyIfNeeded()
/external/caliper/caliper/src/main/java/com/google/caliper/util/
DUtil.java23 import com.google.common.io.ByteSource;
69 public static ImmutableMap<String, String> loadProperties(ByteSource is) throws IOException { in loadProperties()
81 public static ByteSource resourceSupplier(final Class<?> c, final String name) { in resourceSupplier()
/external/robolectric-shadows/shadows/framework/src/main/java/org/robolectric/shadows/util/
DSQLiteLibraryLoader.java6 import com.google.common.io.ByteSource;
65 private ByteSource getLibraryByteSource() { in getLibraryByteSource()

123