Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 273 for byte (0.14 sec)

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

        }
    
        @Override
        public byte[] getExpected(byte[] bytes) {
          if (initialBytes == null) {
            return checkNotNull(bytes);
          } else {
            byte[] result = new byte[initialBytes.length + bytes.length];
            System.arraycopy(initialBytes, 0, result, 0, initialBytes.length);
            System.arraycopy(bytes, 0, result, initialBytes.length, bytes.length);
            return result;
          }
        }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/LittleEndianDataOutputStreamTest.java

        out.writeBytes("\uAAAA\uAABB\uAACC");
    
        byte[] data = baos.toByteArray();
    
        /* Setup input streams */
        DataInput in = new DataInputStream(new ByteArrayInputStream(data));
    
        /* Read in various values NORMALLY */
        byte[] b = new byte[3];
        in.readFully(b);
        byte[] expected = {(byte) 0xAA, (byte) 0xBB, (byte) 0xCC};
        assertEquals(expected, b);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/primitives/SignedBytes.java

       *     {@link Byte#MAX_VALUE} if it is too large, or {@link Byte#MIN_VALUE} if it is too small
       */
      public static byte saturatedCast(long value) {
        if (value > Byte.MAX_VALUE) {
          return Byte.MAX_VALUE;
        }
        if (value < Byte.MIN_VALUE) {
          return Byte.MIN_VALUE;
        }
        return (byte) value;
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 22 13:09:25 GMT 2021
    - 7.5K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/HashTestUtils.java

      /** Converts a string, which should contain only ascii-representable characters, to a byte[]. */
      static byte[] ascii(String string) {
        byte[] bytes = new byte[string.length()];
        for (int i = 0; i < string.length(); i++) {
          bytes[i] = (byte) string.charAt(i);
        }
        return bytes;
      }
    
      interface HashFn {
        byte[] hash(byte[] input, int seed);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 25.3K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/hash/PrimitiveSink.java

       * {@code bytes[off + len - 1]} is the last.
       *
       * @param bytes a byte array
       * @param off the start offset in the array
       * @param len the number of bytes to write
       * @return this instance
       * @throws IndexOutOfBoundsException if {@code off < 0} or {@code off + len > bytes.length} or
       *     {@code len < 0}
       */
      @CanIgnoreReturnValue
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 3.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/hash/SipHashFunctionTest.java

      public void testCollisionsDueToIncorrectSignExtension() {
        byte[] col1 = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, (byte) 0x80};
        byte[] col2 = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, (byte) 0x81};
        byte[] col3 = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, (byte) 0xff};
    
        ImmutableSet<HashCode> hashCodes =
            ImmutableSet.of(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Sun May 05 18:02:35 GMT 2019
    - 6.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/ByteArrayDataInput.java

      @Override
      byte readByte();
    
      @CanIgnoreReturnValue // to skip a byte
      @Override
      int readUnsignedByte();
    
      @CanIgnoreReturnValue // to skip some bytes
      @Override
      short readShort();
    
      @CanIgnoreReturnValue // to skip some bytes
      @Override
      int readUnsignedShort();
    
      @CanIgnoreReturnValue // to skip some bytes
      @Override
      char readChar();
    
      @CanIgnoreReturnValue // to skip some bytes
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/primitives/SignedBytesTest.java

      }
    
      @J2ktIncompatible // b/285319375
      public void testLexicographicalComparator() {
        List<byte[]> ordered =
            Arrays.asList(
                new byte[] {},
                new byte[] {LEAST},
                new byte[] {LEAST, LEAST},
                new byte[] {LEAST, (byte) 1},
                new byte[] {(byte) 1},
                new byte[] {(byte) 1, LEAST},
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/primitives/Longs.java

       * @throws IllegalArgumentException if {@code bytes} has fewer than 8 elements
       */
      public static long fromByteArray(byte[] bytes) {
        checkArgument(bytes.length >= BYTES, "array too small: %s < %s", bytes.length, BYTES);
        return fromBytes(
            bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7]);
      }
    
      /**
       * Returns the {@code long} value whose byte representation is the given 8 bytes, in big-endian
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 28.7K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/primitives/IntsTest.java

        try {
          Ints.fromByteArray(new byte[Ints.BYTES - 1]);
          fail();
        } catch (IllegalArgumentException expected) {
        }
      }
    
      public void testFromBytes() {
        assertThat(Ints.fromBytes((byte) 0x12, (byte) 0x13, (byte) 0x14, (byte) 0x15))
            .isEqualTo(0x12131415);
        assertThat(Ints.fromBytes((byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC))
            .isEqualTo(0xFFEEDDCC);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 28.4K bytes
    - Viewed (0)
Back to top