Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for slice (0.22 sec)

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

      public void testSlice_constrainedRange() throws IOException {
        long size = source.read().length;
        if (size >= 2) {
          ByteSource sliced = source.slice(1, size - 2);
          assertEquals(size - 2, sliced.read().length);
          ByteSource resliced = sliced.slice(0, size - 1);
          assertTrue(sliced.contentEquals(resliced));
        }
      }
    
      private void assertExpectedBytes(byte[] readBytes) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/ByteSourceTester.java

      public void testSlice_constrainedRange() throws IOException {
        long size = source.read().length;
        if (size >= 2) {
          ByteSource sliced = source.slice(1, size - 2);
          assertEquals(size - 2, sliced.read().length);
          ByteSource resliced = sliced.slice(0, size - 1);
          assertTrue(sliced.contentEquals(resliced));
        }
      }
    
      private void assertExpectedBytes(byte[] readBytes) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/CharSourceTester.java

        TestSuite suite = suiteForString(factory, new String(bytes, Charsets.UTF_8), name, desc);
        ByteSourceFactory byteSourceFactory = SourceSinkFactories.asByteSourceFactory(factory);
        suite.addTest(
            ByteSourceTester.suiteForBytes(
                byteSourceFactory, bytes, name + ".asByteSource[Charset]", desc, slice));
        return suite;
      }
    
    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)
  4. guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java

        int chunk2 = dataSize - chunk1;
    
        // Write just enough to not trip the threshold
        if (chunk1 > 0) {
          write(out, data, 0, chunk1, singleByte);
          assertTrue(ByteSource.wrap(data).slice(0, chunk1).contentEquals(source));
        }
        File file = out.getFile();
        assertNull(file);
    
        // Write data to go over the threshold
        if (chunk2 > 0) {
          if (JAVA_IO_TMPDIR.value().equals("/sdcard")) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/base/Utf8.java

       */
      public static boolean isWellFormed(byte[] bytes) {
        return isWellFormed(bytes, 0, bytes.length);
      }
    
      /**
       * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
       * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
       * isWellFormed(bytes)} is true.
       *
       * @param bytes the input buffer
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/CharSourceTester.java

        TestSuite suite = suiteForString(factory, new String(bytes, Charsets.UTF_8), name, desc);
        ByteSourceFactory byteSourceFactory = SourceSinkFactories.asByteSourceFactory(factory);
        suite.addTest(
            ByteSourceTester.suiteForBytes(
                byteSourceFactory, bytes, name + ".asByteSource[Charset]", desc, slice));
        return suite;
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 7.3K bytes
    - Viewed (0)
  7. guava/src/com/google/common/base/Utf8.java

       */
      public static boolean isWellFormed(byte[] bytes) {
        return isWellFormed(bytes, 0, bytes.length);
      }
    
      /**
       * Returns whether the given byte array slice is a well-formed UTF-8 byte sequence, as defined by
       * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
       * isWellFormed(bytes)} is true.
       *
       * @param bytes the input buffer
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/FileBackedOutputStreamTest.java

        int chunk2 = dataSize - chunk1;
    
        // Write just enough to not trip the threshold
        if (chunk1 > 0) {
          write(out, data, 0, chunk1, singleByte);
          assertTrue(ByteSource.wrap(data).slice(0, chunk1).contentEquals(source));
        }
        File file = out.getFile();
        assertNull(file);
    
        // Write data to go over the threshold
        if (chunk2 > 0) {
          if (JAVA_IO_TMPDIR.value().equals("/sdcard")) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/SourceSinkFactory.java

       * the source or written to the sink. Typically, this will just return the input directly, but in
       * some cases it may alter the input. For example, if the factory returns a sliced view of a
       * source created with some given bytes, this method would return a subsequence of the given
       * (byte[]) data.
       */
      T getExpected(T data);
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/io/ResourcesTest.java

        assertEquals(ImmutableList.of(I18N), Resources.readLines(resource, Charsets.UTF_8));
      }
    
      public void testReadLines_withLineProcessor() throws IOException {
        URL resource = getClass().getResource("testdata/alice_in_wonderland.txt");
        LineProcessor<List<String>> collectAndLowercaseAndTrim =
            new LineProcessor<List<String>>() {
              List<String> collector = new ArrayList<>();
    
              @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.8K bytes
    - Viewed (0)
Back to top