Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 34 for Writer (0.17 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/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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. guava-tests/test/com/google/common/io/CharSourceTest.java

        assertFalse(source.wasStreamClosed());
    
        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();
    
        assertTrue(source.wasStreamClosed());
        assertEquals(STRING, writer.toString());
      }
    
      public void testLines() throws IOException {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/io/BaseEncoding.java

       * {@code Writer}. When the returned {@code OutputStream} is closed, so is the backing {@code
       * Writer}.
       */
      @J2ktIncompatible
      @GwtIncompatible // Writer,OutputStream
      public abstract OutputStream encodingStream(Writer writer);
    
      /**
       * Returns a {@code ByteSink} that writes base-encoded bytes to the specified {@code CharSink}.
       */
      @J2ktIncompatible
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Mar 15 16:33:32 GMT 2024
    - 41.7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/io/CharSource.java

        }
    
        @Override
        public long copyTo(CharSink sink) throws IOException {
          checkNotNull(sink);
          Closer closer = Closer.create();
          try {
            Writer writer = closer.register(sink.openStream());
            writer.write((String) seq);
            return seq.length();
          } catch (Throwable e) {
            throw closer.rethrow(e);
          } finally {
            closer.close();
          }
        }
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 22.4K bytes
    - Viewed (0)
  10. guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java

    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.PrintStream;
    import java.io.PrintWriter;
    import java.io.Reader;
    import java.io.StringReader;
    import java.io.StringWriter;
    import java.io.Writer;
    import java.lang.reflect.AnnotatedElement;
    import java.lang.reflect.GenericDeclaration;
    import java.lang.reflect.Type;
    import java.math.BigDecimal;
    import java.math.BigInteger;
    import java.nio.Buffer;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.1K bytes
    - Viewed (0)
Back to top