Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 65 for SetBytes (0.16 sec)

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

        byte[] data = new byte[17];
        data[1] = 15;
        System.arraycopy("Kilroy was here".getBytes(Charsets.UTF_8), 0, data, 2, 15);
        ByteArrayDataInput in = ByteStreams.newDataInput(data);
        assertEquals("Kilroy was here", in.readUTF());
      }
    
      public void testNewDataInput_readChar() {
        byte[] data = "qed".getBytes(Charsets.UTF_16BE);
        ByteArrayDataInput in = ByteStreams.newDataInput(data);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (1)
  2. android/guava-tests/test/com/google/common/io/TestByteSink.java

      private boolean outputStreamOpened;
      private boolean outputStreamClosed;
    
      public TestByteSink(TestOption... options) {
        this.options = ImmutableSet.copyOf(options);
      }
    
      byte[] getBytes() {
        return bytes.toByteArray();
      }
    
      @Override
      public boolean wasStreamOpened() {
        return outputStreamOpened;
      }
    
      @Override
      public boolean wasStreamClosed() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Apr 21 02:27:51 GMT 2017
    - 1.8K bytes
    - Viewed (0)
  3. guava/src/com/google/common/base/Utf8.java

    @GwtCompatible(emulated = true)
    @ElementTypesAreNonnullByDefault
    public final class Utf8 {
      /**
       * Returns the number of bytes in the UTF-8-encoded form of {@code sequence}. For a string, this
       * method is equivalent to {@code string.getBytes(UTF_8).length}, but is more efficient in both
       * time and space.
       *
       * @throws IllegalArgumentException if {@code sequence} contains ill-formed UTF-16 (unpaired
       *     surrogates)
       */
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/hash/AbstractHasher.java

        }
        return this;
      }
    
      @Override
      @CanIgnoreReturnValue
      public Hasher putString(CharSequence charSequence, Charset charset) {
        return putBytes(charSequence.toString().getBytes(charset));
      }
    
      @Override
      @CanIgnoreReturnValue
      public Hasher putBytes(byte[] bytes) {
        return putBytes(bytes, 0, bytes.length);
      }
    
      @Override
      @CanIgnoreReturnValue
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 3.5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

          random.nextBytes(bytes);
          String s = new String(bytes, UTF_16LE); // so all random strings are valid
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
              new TestHasher().putBytes(s.getBytes(UTF_16LE)).hash());
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
              new TestHasher().putString(s, UTF_16LE).hash());
        }
      }
    
      public void testFloat() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/ByteSinkTester.java

          suite.addTest(stringSuite);
        }
        return suite;
      }
    
      private static TestSuite suiteForString(
          String name, ByteSinkFactory factory, String string, String desc) {
        byte[] bytes = string.getBytes(Charsets.UTF_8);
        TestSuite suite = suiteForBytes(name, factory, desc, bytes);
        CharSinkFactory charSinkFactory = SourceSinkFactories.asCharSinkFactory(factory);
        suite.addTest(
            CharSinkTester.suiteForString(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 4K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java

        DataInput in = new DataInputStream(new ByteArrayInputStream(data));
    
        /* Read in various values NORMALLY */
        byte[] b = new byte[6];
        in.readFully(b);
        assertEquals("r\u00C9sum\u00C9".getBytes(Charsets.ISO_8859_1), b);
      }
    
      @SuppressWarnings("deprecation") // testing a deprecated method
      public void testWriteBytes_discardHighOrderBytes() throws IOException {
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

          random.nextBytes(bytes);
          String s = new String(bytes, UTF_16LE); // so all random strings are valid
          assertEquals(
              new Sink(4).putUnencodedChars(s).hash(),
              new Sink(4).putBytes(s.getBytes(UTF_16LE)).hash());
          assertEquals(
              new Sink(4).putUnencodedChars(s).hash(), new Sink(4).putString(s, UTF_16LE).hash());
        }
      }
    
      public void testFloat() {
        Sink sink = new Sink(4);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/base/Utf8Test.java

          boolean isRoundTrippable = Utf8.isWellFormed(bytes);
          assertEquals(isRoundTrippable, Utf8.isWellFormed(bytes, 0, numBytes));
          String s = new String(bytes, Charsets.UTF_8);
          byte[] bytesReencoded = s.getBytes(Charsets.UTF_8);
          boolean bytesEqual = Arrays.equals(bytes, bytesReencoded);
    
          if (bytesEqual != isRoundTrippable) {
            fail();
          }
          if (isRoundTrippable) {
            countRoundTripped++;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/reflect/ClassPathTest.java

          throw closer.rethrow(e);
        } finally {
          closer.close();
        }
      }
    
      private static Manifest manifest(String content) throws IOException {
        InputStream in = new ByteArrayInputStream(content.getBytes(US_ASCII));
        Manifest manifest = new Manifest();
        manifest.read(in);
        return manifest;
      }
    
      private static File fullpath(String path) {
        return new File(new File(path).toURI());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Apr 26 14:02:27 GMT 2024
    - 24.9K bytes
    - Viewed (0)
Back to top