Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for asReader (0.27 sec)

  1. src/image/format.go

    	formatsMu.Unlock()
    }
    
    // A reader is an io.Reader that can also peek ahead.
    type reader interface {
    	io.Reader
    	Peek(int) ([]byte, error)
    }
    
    // asReader converts an io.Reader to a reader.
    func asReader(r io.Reader) reader {
    	if rr, ok := r.(reader); ok {
    		return rr
    	}
    	return bufio.NewReader(r)
    }
    
    // match reports whether magic matches b. Magic may contain "?" wildcards.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:45 UTC 2023
    - 3K bytes
    - Viewed (0)
  2. platforms/software/resources/src/test/groovy/org/gradle/internal/resource/UriTextResourceTest.groovy

            UriTextResource resource = new UriTextResource('<display-name>', file, resolver)
    
            then:
            resource.exists
            !resource.hasEmptyContent
            resource.text == '<content>'
            resource.asReader.text == '<content>'
        }
    
        def assumesFileIsEncodedUsingUtf8() throws IOException {
            when:
            file.setText('\u03b1', 'utf-8')
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 9.4K bytes
    - Viewed (0)
  3. platforms/software/resources/src/test/groovy/org/gradle/internal/resource/CachingTextResourceTest.groovy

            1 * target.text >> 'content'
            0 * target._
        }
    
        def fetchesAndCachesContentWhenContentQueriedAsReader() {
            when:
            assert resource.asReader.text == 'content'
            assert resource.exists
            assert resource.asReader.text == 'content'
    
            then:
            1 * target.text >> 'content'
            0 * target._
        }
    
        def fetchesAndCachesContentWhenContentIsEmptyIsChecked() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  4. subprojects/core/src/test/groovy/org/gradle/api/internal/resources/CharSourceBackedTextResourceTest.groovy

        def "can use char source text resource"() {
            when:
            def r = new CharSourceBackedTextResource("display name", CharSource.wrap("foo"))
    
            then:
            r.asString() == "foo"
            r.asReader().text == "foo"
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Mar 17 02:08:55 UTC 2016
    - 1K bytes
    - Viewed (0)
  5. subprojects/core/src/test/groovy/org/gradle/api/internal/resources/AbstractTextResourceTest.groovy

        TextResource resource
    
        def "read as string"() {
            expect:
            resource.asString() == "contents"
        }
    
        def "read as reader"() {
            expect:
            def reader = resource.asReader()
    
            try {
                reader.readLine() == "contents"
            } finally {
                reader.close()
            }
        }
    
        def "read as file"() {
            expect:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri May 27 11:20:55 UTC 2016
    - 1.4K bytes
    - Viewed (0)
  6. platforms/documentation/docs/src/docs/dsl/org.gradle.api.resources.TextResource.xml

                    <tr>
                        <td>Name</td>
                    </tr>
                </thead>
                <tr>
                    <td>asString</td>
                </tr>
                <tr>
                    <td>asReader</td>
                </tr>
                <tr>
                    <td>asFile</td>
                </tr>
            </table>
        </section>
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/LineBufferTest.java

          lines.add(line);
        }
        r.close();
        return lines;
      }
    
      private static List<String> readUsingReader(String input, int chunk, boolean asReader)
          throws IOException {
        Readable readable =
            asReader ? getChunkedReader(input, chunk) : getChunkedReadable(input, chunk);
        LineReader r = new LineReader(readable);
        List<String> lines = Lists.newArrayList();
        String line;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/LineBufferTest.java

          lines.add(line);
        }
        r.close();
        return lines;
      }
    
      private static List<String> readUsingReader(String input, int chunk, boolean asReader)
          throws IOException {
        Readable readable =
            asReader ? getChunkedReader(input, chunk) : getChunkedReadable(input, chunk);
        LineReader r = new LineReader(readable);
        List<String> lines = Lists.newArrayList();
        String line;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 4.7K bytes
    - Viewed (0)
  9. subprojects/core/src/main/java/org/gradle/api/internal/resources/StringBackedTextResource.java

        @Override
        public String toString() {
            return getDisplayName();
        }
    
        @Override
        public String asString() {
            return string;
        }
    
        @Override
        public Reader asReader() {
            return new StringReader(string);
        }
    
        @Override
        public File asFile(String charset) {
            File file = tempFileProvider.createTemporaryFile("string", ".txt", "resource");
            try {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Feb 02 16:14:10 UTC 2021
    - 2.6K bytes
    - Viewed (0)
  10. subprojects/core/src/main/java/org/gradle/api/internal/resources/CharSourceBackedTextResource.java

            try {
                return charSource.read();
            } catch (IOException e) {
                throw ResourceExceptions.readFailed(displayName, e);
            }
        }
    
        @Override
        public Reader asReader() {
            try {
                return charSource.openStream();
            } catch (IOException e) {
                throw ResourceExceptions.readFailed(displayName, e);
            }
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Aug 27 15:36:08 UTC 2018
    - 2.5K bytes
    - Viewed (0)
Back to top