Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for NewWriter (0.19 sec)

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

      public void testNewWriter() throws IOException {
        File temp = createTempFile();
        assertThrows(NullPointerException.class, () -> Files.newWriter(temp, null));
    
        assertThrows(NullPointerException.class, () -> Files.newWriter(null, Charsets.UTF_8));
    
        BufferedWriter w = Files.newWriter(temp, Charsets.UTF_8);
        try {
          w.write(I18N);
        } finally {
          w.close();
        }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/FilesTest.java

      public void testNewWriter() throws IOException {
        File temp = createTempFile();
        assertThrows(NullPointerException.class, () -> Files.newWriter(temp, null));
    
        assertThrows(NullPointerException.class, () -> Files.newWriter(null, Charsets.UTF_8));
    
        BufferedWriter w = Files.newWriter(temp, Charsets.UTF_8);
        try {
          w.write(I18N);
        } finally {
          w.close();
        }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/CharSourceTest.java

          assertThrows(IOException.class, () -> okSource.copyTo(new TestCharSink(option)));
          // ensure reader was closed IF it was opened (depends on implementation whether or not it's
          // opened at all if sink.newWriter() throws).
          assertTrue(
              "stream not closed when copying to sink with option: " + option,
              !okSource.wasStreamOpened() || okSource.wasStreamClosed());
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/CharSourceTest.java

          assertThrows(IOException.class, () -> okSource.copyTo(new TestCharSink(option)));
          // ensure reader was closed IF it was opened (depends on implementation whether or not it's
          // opened at all if sink.newWriter() throws).
          assertTrue(
              "stream not closed when copying to sink with option: " + option,
              !okSource.wasStreamOpened() || okSource.wasStreamClosed());
        }
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/io/Files.java

       * @param charset the charset used to encode the output stream; see {@link StandardCharsets} for
       *     helpful predefined constants
       * @return the buffered writer
       */
      public static BufferedWriter newWriter(File file, Charset charset) throws FileNotFoundException {
        checkNotNull(file);
        checkNotNull(charset);
        return new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), charset));
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 33.1K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/LinkedHashMultimap.java

         * lying about the fields below on the grounds that we always initialize them just after the
         * constructor -- an example of the kind of lying that our hypothetical bytecode rewriter would
         * already have to deal with, thanks to DI frameworks that perform field and method injection,
         * frameworks like Android that define post-construct hooks like Activity.onCreate, etc.
         */
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 23.6K bytes
    - Viewed (0)
Back to top