Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 51 for putBytes (0.21 sec)

  1. android/guava/src/com/google/common/hash/Hasher.java

     * following three expressions all generate colliding hash codes:
     *
     * <pre>{@code
     * newHasher().putByte(b1).putByte(b2).putByte(b3).hash()
     * newHasher().putByte(b1).putBytes(new byte[] { b2, b3 }).hash()
     * newHasher().putBytes(new byte[] { b1, b2, b3 }).hash()
     * }</pre>
     *
     * <p>If you wish to avoid this, you should either prepend or append the size of each chunk. Keep in
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 5.5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/hash/AbstractHasher.java

      }
    
      @Override
      @CanIgnoreReturnValue
      public Hasher putShort(short s) {
        putByte((byte) s);
        putByte((byte) (s >>> 8));
        return this;
      }
    
      @Override
      @CanIgnoreReturnValue
      public Hasher putInt(int i) {
        putByte((byte) i);
        putByte((byte) (i >>> 8));
        putByte((byte) (i >>> 16));
        putByte((byte) (i >>> 24));
        return this;
      }
    
      @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)
  3. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        TestHasher hasher = new TestHasher(); // byte order insignificant here
        byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
        hasher.putByte((byte) 1);
        hasher.putBytes(new byte[] {2, 3, 4, 5, 6});
        hasher.putByte((byte) 7);
        hasher.putBytes(new byte[] {});
        hasher.putBytes(new byte[] {8});
        hasher.assertBytes(expected);
      }
    
      public void testShort() {
        TestHasher hasher = new TestHasher();
    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)
  4. guava-tests/test/com/google/common/hash/FunnelsTest.java

        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(
            Funnels.byteArrayFunnel(), SerializableTester.reserialize(Funnels.byteArrayFunnel()));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5.9K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

        int numOfByteRead = in.read(buf, 0, buf.length);
        assertEquals(4, numOfByteRead);
        for (int i = 0; i < testBytes.length; i++) {
          assertEquals(testBytes[i], buf[i]);
        }
    
        verify(hasher).putBytes(testBytes, 0, testBytes.length);
        verify(hashFunction).newHasher();
        verifyNoMoreInteractions(hashFunction, hasher);
      }
    
      public void testRead_putByteArrayAtPos() throws Exception {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

      public void testBytes() {
        Sink sink = new Sink(4); // byte order insignificant here
        byte[] expected = {1, 2, 3, 4, 5, 6, 7, 8};
        sink.putByte((byte) 1);
        sink.putBytes(new byte[] {2, 3, 4, 5, 6});
        sink.putByte((byte) 7);
        sink.putBytes(new byte[] {});
        sink.putBytes(new byte[] {8});
        HashCode unused = sink.hash();
        sink.assertInvariants(8);
        sink.assertBytes(expected);
      }
    
    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)
  7. android/guava-tests/test/com/google/common/hash/FunnelsTest.java

        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(
            Funnels.byteArrayFunnel(), SerializableTester.reserialize(Funnels.byteArrayFunnel()));
    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)
  8. android/guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java

        verify(hasher).putByte((byte) b);
        verifyNoMoreInteractions(hashFunction, hasher);
      }
    
      public void testWrite_putByteArray() throws Exception {
        byte[] buf = new byte[] {'y', 'a', 'm', 's'};
        HashingOutputStream out = new HashingOutputStream(hashFunction, buffer);
        out.write(buf);
    
        verify(hashFunction).newHasher();
        verify(hasher).putBytes(buf, 0, buf.length);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 3.1K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/hash/Funnels.java

        }
    
        @Override
        public void write(int b) {
          sink.putByte((byte) b);
        }
    
        @Override
        public void write(byte[] bytes) {
          sink.putBytes(bytes);
        }
    
        @Override
        public void write(byte[] bytes, int off, int len) {
          sink.putBytes(bytes, off, len);
        }
    
        @Override
        public String toString() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 25 20:32:46 GMT 2022
    - 7.3K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

        int numOfByteRead = in.read(buf, 0, buf.length);
        assertEquals(4, numOfByteRead);
        for (int i = 0; i < testBytes.length; i++) {
          assertEquals(testBytes[i], buf[i]);
        }
    
        verify(hasher).putBytes(testBytes, 0, testBytes.length);
        verify(hashFunction).newHasher();
        verifyNoMoreInteractions(hashFunction, hasher);
      }
    
      public void testRead_putByteArrayAtPos() throws Exception {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5K bytes
    - Viewed (0)
Back to top