Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 35 for ByteSource (0.11 sec)

  1. android/guava-tests/test/com/google/common/io/MoreFilesTest.java

      public void testByteSource_size_ofDirectory() throws IOException {
        try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) {
          Path dir = fs.getPath("dir");
          Files.createDirectory(dir);
    
          ByteSource source = MoreFiles.asByteSource(dir);
    
          assertThat(source.sizeIfKnown()).isAbsent();
    
          assertThrows(IOException.class, () -> source.size());
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

              .put(FloatBuffer.class, FloatBuffer.allocate(0))
              .put(DoubleBuffer.class, DoubleBuffer.allocate(0))
              .put(File.class, new File(""))
              .put(ByteSource.class, ByteSource.empty())
              .put(CharSource.class, CharSource.empty())
              .put(ByteSink.class, NullByteSink.INSTANCE)
              .put(CharSink.class, NullByteSink.INSTANCE.asCharSink(UTF_8))
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/TestByteSource.java

    import java.io.InputStream;
    import java.util.Random;
    
    /**
     * A byte source for testing that has configurable behavior.
     *
     * @author Colin Decker
     */
    public final class TestByteSource extends ByteSource implements TestStreamSupplier {
    
      private final byte[] bytes;
      private final ImmutableSet<TestOption> options;
    
      private boolean inputStreamOpened;
      private boolean inputStreamClosed;
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Apr 21 02:27:51 UTC 2017
    - 1.9K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/io/TestByteSource.java

    import java.io.InputStream;
    import java.util.Random;
    
    /**
     * A byte source for testing that has configurable behavior.
     *
     * @author Colin Decker
     */
    public final class TestByteSource extends ByteSource implements TestStreamSupplier {
    
      private final byte[] bytes;
      private final ImmutableSet<TestOption> options;
    
      private boolean inputStreamOpened;
      private boolean inputStreamClosed;
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Sep 15 13:47:32 UTC 2016
    - 1.9K bytes
    - Viewed (0)
  5. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

              .put(FloatBuffer.class, FloatBuffer.allocate(0))
              .put(DoubleBuffer.class, DoubleBuffer.allocate(0))
              .put(File.class, new File(""))
              .put(ByteSource.class, ByteSource.empty())
              .put(CharSource.class, CharSource.empty())
              .put(ByteSink.class, NullByteSink.INSTANCE)
              .put(CharSink.class, NullByteSink.INSTANCE.asCharSink(UTF_8))
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 20.8K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/FilesTest.java

        suite.addTestSuite(FilesTest.class);
        return suite;
      }
    
      public void testRoundTripSources() throws Exception {
        File asciiFile = getTestFile("ascii.txt");
        ByteSource byteSource = Files.asByteSource(asciiFile);
        assertSame(byteSource, byteSource.asCharSource(UTF_8).asByteSource(UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jul 23 14:22:54 UTC 2024
    - 22.1K bytes
    - Viewed (0)
  7. android/guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java

        assertFreshInstanceReturned(
            ByteArrayOutputStream.class, OutputStream.class,
            Writer.class, StringWriter.class,
            PrintStream.class, PrintWriter.class);
        assertEquals(ByteSource.empty(), ArbitraryInstances.get(ByteSource.class));
        assertEquals(CharSource.empty(), ArbitraryInstances.get(CharSource.class));
        assertNotNull(ArbitraryInstances.get(ByteSink.class));
        assertNotNull(ArbitraryInstances.get(CharSink.class));
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:26:48 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/io/MoreFiles.java

       */
      public static ByteSource asByteSource(Path path, OpenOption... options) {
        return new PathByteSource(path, options);
      }
    
      @IgnoreJRERequirement // *should* be redundant with the one on MoreFiles itself
      private static final class PathByteSource extends
          ByteSource
      {
    
        private static final LinkOption[] FOLLOW_LINKS = {};
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 35K bytes
    - Viewed (0)
  9. guava/src/com/google/common/io/MoreFiles.java

       * equivalent to providing the {@link StandardOpenOption#READ READ} option.
       */
      public static ByteSource asByteSource(Path path, OpenOption... options) {
        return new PathByteSource(path, options);
      }
    
      private static final class PathByteSource extends
          ByteSource
      {
    
        private static final LinkOption[] FOLLOW_LINKS = {};
    
        private final Path path;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 16:07:00 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/reflect/ClassPath.java

          }
          return url;
        }
    
        /**
         * Returns a {@link ByteSource} view of the resource from which its bytes can be read.
         *
         * @throws NoSuchElementException if the resource cannot be loaded through the class loader,
         *     despite physically existing in the class path.
         * @since 20.0
         */
        public final ByteSource asByteSource() {
          return Resources.asByteSource(url());
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jan 05 17:43:40 UTC 2022
    - 24.9K bytes
    - Viewed (0)
Back to top