Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 69 for Writer (0.2 sec)

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

          throws IOException {
        StringWriter writer = new StringWriter();
        try (OutputStream encodingStream = encoding.encodingStream(writer)) {
          encodingStream.write(decoded.getBytes(UTF_8));
        }
        assertThat(writer.toString()).isEqualTo(encoded);
      }
    
      @GwtIncompatible // Reader
      private static void testStreamingDecodes(BaseEncoding encoding, String encoded, String decoded)
          throws IOException {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Aug 25 16:34:08 GMT 2022
    - 24.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/AppendableWriterTest.java

        StringBuilder builder = new StringBuilder();
        Writer writer = new AppendableWriter(builder);
    
        writer.write("Hello".toCharArray());
        writer.write(',');
        writer.write(0xBEEF0020); // only lower 16 bits are important
        writer.write("Wo");
        writer.write("Whirled".toCharArray(), 3, 2);
        writer.write("Mad! Mad, I say", 2, 2);
    
        assertEquals("Hello, World!", builder.toString());
      }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/CharStreamsTest.java

      }
    
      public void testNullWriter() throws Exception {
        // create a null writer
        Writer nullWriter = CharStreams.nullWriter();
        // write to the writer
        nullWriter.write('n');
        String test = "Test string for NullWriter";
        nullWriter.write(test);
        nullWriter.write(test, 2, 10);
        nullWriter.append(null);
        nullWriter.append(null, 0, 4);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 11.2K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/CharStreamsTest.java

      }
    
      public void testNullWriter() throws Exception {
        // create a null writer
        Writer nullWriter = CharStreams.nullWriter();
        // write to the writer
        nullWriter.write('n');
        String test = "Test string for NullWriter";
        nullWriter.write(test);
        nullWriter.write(test, 2, 10);
        nullWriter.append(null);
        nullWriter.append(null, 0, 4);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 11.2K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/io/CharStreams.java

        }
      }
    
      /**
       * Returns a Writer that sends all output to the given {@link Appendable} target. Closing the
       * writer will close the target if it is {@link Closeable}, and flushing the writer will flush the
       * target if it is {@link java.io.Flushable}.
       *
       * @param target the object to which output will be sent
       * @return a new Writer object, unless target is a Writer, in which case the target is returned
       */
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/AppendableWriter.java

    class AppendableWriter extends Writer {
      private final Appendable target;
      private boolean closed;
    
      /**
       * Creates a new writer that appends everything it writes to {@code target}.
       *
       * @param target target to which to append output
       */
      AppendableWriter(Appendable target) {
        this.target = checkNotNull(target);
      }
    
      /*
       * Abstract methods from Writer
       */
    
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 3.4K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/CharSinkTester.java

        Writer writer = sink.openStream();
        try {
          writer.write(data);
        } finally {
          writer.close();
        }
    
        assertContainsExpectedString();
      }
    
      public void testOpenBufferedStream() throws IOException {
        Writer writer = sink.openBufferedStream();
        try {
          writer.write(data);
        } finally {
          writer.close();
        }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 4K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/SourceSinkFactories.java

        public CharSink createSink() throws IOException {
          File file = createFile();
          if (initialString != null) {
            Writer writer = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8);
            try {
              writer.write(initialString);
            } finally {
              writer.close();
            }
            return Files.asCharSink(file, Charsets.UTF_8, FileWriteMode.APPEND);
          }
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Sep 09 17:57:59 GMT 2021
    - 17.9K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/CharSourceTester.java

        Reader reader = source.openStream();
    
        StringWriter writer = new StringWriter();
        char[] buf = new char[64];
        int read;
        while ((read = reader.read(buf)) != -1) {
          writer.write(buf, 0, read);
        }
        reader.close();
        writer.close();
    
        assertExpectedString(writer.toString());
      }
    
      public void testOpenBufferedStream() throws IOException {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 6.8K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/io/BaseEncodingTest.java

          throws IOException {
        StringWriter writer = new StringWriter();
        try (OutputStream encodingStream = encoding.encodingStream(writer)) {
          encodingStream.write(decoded.getBytes(UTF_8));
        }
        assertThat(writer.toString()).isEqualTo(encoded);
      }
    
      @GwtIncompatible // Reader
      private static void testStreamingDecodes(BaseEncoding encoding, String encoded, String decoded)
          throws IOException {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 24.6K bytes
    - Viewed (0)
Back to top