Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 209 for bytes (0.14 sec)

  1. android/guava/src/com/google/common/primitives/Bytes.java

       * @param arrays zero or more {@code byte} arrays
       * @return a single array containing all the values from the source arrays, in order
       */
      public static byte[] concat(byte[]... arrays) {
        int length = 0;
        for (byte[] array : arrays) {
          length += array.length;
        }
        byte[] result = new byte[length];
        int pos = 0;
        for (byte[] array : arrays) {
          System.arraycopy(array, 0, result, pos, array.length);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/base/Utf8.java

            }
            int byte2 = bytes[index++];
            if (byte2 > (byte) 0xBF
                // Overlong? 5 most significant bits must not all be zero.
                || (byte1 == (byte) 0xE0 && byte2 < (byte) 0xA0)
                // Check for illegal surrogate codepoints.
                || (byte1 == (byte) 0xED && (byte) 0xA0 <= byte2)
                // Third byte trailing-byte test.
                || bytes[index++] > (byte) 0xBF) {
              return false;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/base/Utf8Test.java

          actual += expected;
        }
        assertEquals(EXPECTED_FOUR_BYTE_ROUNDTRIPPABLE_COUNT, actual);
      }
    
      private static String newString(char... chars) {
        return new String(chars);
      }
    
      private static byte[] toByteArray(int... bytes) {
        byte[] realBytes = new byte[bytes.length];
        for (int i = 0; i < bytes.length; i++) {
          realBytes[i] = (byte) bytes[i];
        }
        return realBytes;
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/hash/MessageDigestHashFunction.java

      }
    
      MessageDigestHashFunction(String algorithmName, int bytes, String toString) {
        this.toString = checkNotNull(toString);
        this.prototype = getMessageDigest(algorithmName);
        int maxLength = prototype.getDigestLength();
        checkArgument(
            bytes >= 4 && bytes <= maxLength, "bytes (%s) must be >= 4 and < %s", bytes, maxLength);
        this.bytes = bytes;
        this.supportsClone = supportsClone(prototype);
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 25 20:32:46 GMT 2022
    - 5K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java

        byte[] bytes = HashTestUtils.ascii(input);
    
        Checksum checksum = supplier.get();
        checksum.update(bytes, 0, bytes.length);
        long value = checksum.getValue();
    
        String toString = "name";
        HashFunction func = new ChecksumHashFunction(supplier, 32, toString);
        assertEquals(toString, func.toString());
        assertEquals(value, func.hashBytes(bytes).padToLong());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Jan 30 14:33:12 GMT 2018
    - 3.1K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/ByteSinkTest.java

        assertFalse(sink.wasStreamClosed());
    
        out.write(new byte[] {1, 2, 3, 4});
        out.close();
    
        assertTrue(sink.wasStreamClosed());
        assertArrayEquals(new byte[] {1, 2, 3, 4}, sink.getBytes());
      }
    
      public void testWrite_bytes() throws IOException {
        assertArrayEquals(new byte[0], sink.getBytes());
        sink.write(bytes);
    
        assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

      }
    
      static TestSuite suiteForBytes(
          ByteSourceFactory factory, byte[] bytes, String name, String desc, boolean slice) {
        TestSuite suite = new TestSuite(name + " [" + desc + "]");
        for (Method method : testMethods) {
          suite.addTest(new ByteSourceTester(factory, bytes, name, desc, method));
        }
    
        if (slice && bytes.length > 0) {
          // test a random slice() of the ByteSource
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java

      }
    
      /** Convenience method to compute a fingerprint on a full bytes array. */
      private static long fingerprint(byte[] bytes) {
        return fingerprint(bytes, bytes.length);
      }
    
      /** Convenience method to compute a fingerprint on a subset of a byte array. */
      private static long fingerprint(byte[] bytes, int length) {
        return HASH_FN.hashBytes(bytes, 0, length).asLong();
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 26 15:56:47 GMT 2017
    - 6.2K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/FunnelsTest.java

        PrimitiveSink sink = mock(PrimitiveSink.class);
        OutputStream out = Funnels.asOutputStream(sink);
        byte[] bytes = {1, 2, 3, 4};
        out.write(255);
        out.write(bytes);
        out.write(bytes, 1, 2);
        verify(sink).putByte((byte) 255);
        verify(sink).putBytes(bytes);
        verify(sink).putBytes(bytes, 1, 2);
      }
    
      public void testSerialization() {
        assertSame(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5.9K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java

        for (int length = 0; length < 1000; length++) {
          byte[] bytes = new byte[length];
          r.nextBytes(bytes);
          assertCrc(referenceCrc(bytes), bytes);
        }
      }
    
      private static int referenceCrc(byte[] bytes) {
        int crc = ~0;
        for (byte b : bytes) {
          crc = (crc >>> 8) ^ Crc32cHashFunction.Crc32cHasher.BYTE_TABLE[(crc ^ b) & 0xFF];
        }
        return ~crc;
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 23 18:30:33 GMT 2020
    - 6.5K bytes
    - Viewed (0)
Back to top