Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 138 for bytes (0.13 sec)

  1. guava-tests/test/com/google/common/net/InetAddressesTest.java

        assertEquals(
            InetAddresses.fromLittleEndianByteArray(new byte[] {1, 2, 3, 4}),
            InetAddress.getByAddress(new byte[] {4, 3, 2, 1}));
    
        assertEquals(
            InetAddresses.fromLittleEndianByteArray(
                new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}),
            InetAddress.getByAddress(
                new byte[] {16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}));
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 31.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/primitives/Shorts.java

       * @throws IllegalArgumentException if {@code bytes} has fewer than 2 elements
       */
      @GwtIncompatible // doesn't work
      public static short fromByteArray(byte[] bytes) {
        checkArgument(bytes.length >= BYTES, "array too small: %s < %s", bytes.length, BYTES);
        return fromBytes(bytes[0], bytes[1]);
      }
    
      /**
       * Returns the {@code short} value whose byte representation is the given 2 bytes, in big-endian
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 25.1K bytes
    - Viewed (0)
  3. 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)
  4. android/guava/src/com/google/common/io/Files.java

      }
    
      /**
       * Reads all bytes from a file into a byte array.
       *
       * <p><b>{@link java.nio.file.Path} equivalent:</b> {@link java.nio.file.Files#readAllBytes}.
       *
       * @param file the file to read from
       * @return a byte array containing all the bytes from file
       * @throws IllegalArgumentException if the file is bigger than the largest possible byte array
       *     (2^31 - 1)
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 33.1K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/MultimapBuilderTest.java

      @J2ktIncompatible
      @GwtIncompatible // serialization
      private static Object reserialize(Object object) throws Exception {
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        new ObjectOutputStream(bytes).writeObject(object);
        return new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray())).readObject();
      }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 27 09:26:07 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/primitives/LongsTest.java

                Longs.fromByteArray(
                    new byte[] {
                      (byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC,
                      (byte) 0xBB, (byte) 0xAA, (byte) 0x99, (byte) 0x88
                    }))
            .isEqualTo(0xFFEEDDCCBBAA9988L);
      }
    
      public void testFromByteArrayFails() {
        try {
          Longs.fromByteArray(new byte[Longs.BYTES - 1]);
          fail();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 30K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/primitives/LongsTest.java

                Longs.fromByteArray(
                    new byte[] {
                      (byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC,
                      (byte) 0xBB, (byte) 0xAA, (byte) 0x99, (byte) 0x88
                    }))
            .isEqualTo(0xFFEEDDCCBBAA9988L);
      }
    
      public void testFromByteArrayFails() {
        try {
          Longs.fromByteArray(new byte[Longs.BYTES - 1]);
          fail();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 30K bytes
    - Viewed (0)
  8. maven-core/src/test/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ThreadOutputMuxerTest.java

                expectedLength += stringList.get(i).length();
            }
    
            threadOutputMuxer.close();
            final byte[] bytes = byteArrayOutputStream.toByteArray();
            String result = new String(bytes);
            assertEquals(expectedLength, bytes.length, result);
        }
    
        class Outputter implements Callable<ProjectSegment> {
            private final ThreadOutputMuxer threadOutputMuxer;
    
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Wed Sep 06 08:39:32 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  9. 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 Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 28.4K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/hash/Hashing.java

          }
        }
    
        @Override
        HashCode makeHash(Hasher[] hashers) {
          byte[] bytes = new byte[bits() / 8];
          int i = 0;
          for (Hasher hasher : hashers) {
            HashCode newHash = hasher.hash();
            i += newHash.writeBytesTo(bytes, i, newHash.bits() / 8);
          }
          return HashCode.fromBytesNoCopy(bytes);
        }
    
        @Override
        public int bits() {
          int bitSum = 0;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 09 00:37:15 GMT 2024
    - 29.2K bytes
    - Viewed (0)
Back to top