Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for testToByteArray (0.25 sec)

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

      }
    
      private static final byte[] PRE_FILLED_100 = newPreFilledByteArray(100);
    
      public void testToByteArray() throws IOException {
        InputStream in = new ByteArrayInputStream(PRE_FILLED_100);
        byte[] b = ByteStreams.toByteArray(in);
        assertThat(b).isEqualTo(PRE_FILLED_100);
      }
    
      public void testToByteArray_emptyStream() throws IOException {
        InputStream in = newTestStream(0);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

      }
    
      private static final byte[] PRE_FILLED_100 = newPreFilledByteArray(100);
    
      public void testToByteArray() throws IOException {
        InputStream in = new ByteArrayInputStream(PRE_FILLED_100);
        byte[] b = ByteStreams.toByteArray(in);
        assertThat(b).isEqualTo(PRE_FILLED_100);
      }
    
      public void testToByteArray_emptyStream() throws IOException {
        InputStream in = newTestStream(0);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/ResourcesTest.java

        assertEquals(I18N, Resources.toString(resource, Charsets.UTF_8));
        assertThat(Resources.toString(resource, Charsets.US_ASCII)).isNotEqualTo(I18N);
      }
    
      public void testToByteArray() throws IOException {
        URL resource = getClass().getResource("testdata/i18n.txt");
        assertThat(Resources.toByteArray(resource)).isEqualTo(I18N.getBytes(Charsets.UTF_8));
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/io/ResourcesTest.java

        assertEquals(I18N, Resources.toString(resource, Charsets.UTF_8));
        assertThat(Resources.toString(resource, Charsets.US_ASCII)).isNotEqualTo(I18N);
      }
    
      public void testToByteArray() throws IOException {
        URL resource = getClass().getResource("testdata/i18n.txt");
        assertThat(Resources.toByteArray(resource)).isEqualTo(I18N.getBytes(Charsets.UTF_8));
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/io/FilesTest.java

        ByteSource byteSource = Files.asByteSource(asciiFile);
        assertSame(byteSource, byteSource.asCharSource(Charsets.UTF_8).asByteSource(Charsets.UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
        File i18nFile = getTestFile("i18n.txt");
        assertTrue(Arrays.equals(ASCII.getBytes(Charsets.US_ASCII), Files.toByteArray(asciiFile)));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/primitives/ShortsTest.java

        assertThat(Shorts.concat(ARRAY1, ARRAY234))
            .isEqualTo(new short[] {(short) 1, (short) 2, (short) 3, (short) 4});
      }
    
      @GwtIncompatible // Shorts.toByteArray
      public void testToByteArray() {
        assertThat(Shorts.toByteArray((short) 0x2345)).isEqualTo(new byte[] {0x23, 0x45});
        assertThat(Shorts.toByteArray((short) 0xFEDC)).isEqualTo(new byte[] {(byte) 0xFE, (byte) 0xDC});
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 26.6K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/primitives/IntsTest.java

            .isEqualTo(new int[] {(int) 1, (int) 1, (int) 1});
        assertThat(Ints.concat(ARRAY1, ARRAY234))
            .isEqualTo(new int[] {(int) 1, (int) 2, (int) 3, (int) 4});
      }
    
      public void testToByteArray() {
        assertThat(Ints.toByteArray(0x12131415)).isEqualTo(new byte[] {0x12, 0x13, 0x14, 0x15});
        assertThat(Ints.toByteArray(0xFFEEDDCC))
            .isEqualTo(new byte[] {(byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC});
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 28.4K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/FilesTest.java

        ByteSource byteSource = Files.asByteSource(asciiFile);
        assertSame(byteSource, byteSource.asCharSource(Charsets.UTF_8).asByteSource(Charsets.UTF_8));
      }
    
      public void testToByteArray() throws IOException {
        File asciiFile = getTestFile("ascii.txt");
        File i18nFile = getTestFile("i18n.txt");
        assertTrue(Arrays.equals(ASCII.getBytes(Charsets.US_ASCII), Files.toByteArray(asciiFile)));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/primitives/ShortsTest.java

        assertThat(Shorts.concat(ARRAY1, ARRAY234))
            .isEqualTo(new short[] {(short) 1, (short) 2, (short) 3, (short) 4});
      }
    
      @GwtIncompatible // Shorts.toByteArray
      public void testToByteArray() {
        assertThat(Shorts.toByteArray((short) 0x2345)).isEqualTo(new byte[] {0x23, 0x45});
        assertThat(Shorts.toByteArray((short) 0xFEDC)).isEqualTo(new byte[] {(byte) 0xFE, (byte) 0xDC});
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 26.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/primitives/IntsTest.java

            .isEqualTo(new int[] {(int) 1, (int) 1, (int) 1});
        assertThat(Ints.concat(ARRAY1, ARRAY234))
            .isEqualTo(new int[] {(int) 1, (int) 2, (int) 3, (int) 4});
      }
    
      public void testToByteArray() {
        assertThat(Ints.toByteArray(0x12131415)).isEqualTo(new byte[] {0x12, 0x13, 0x14, 0x15});
        assertThat(Ints.toByteArray(0xFFEEDDCC))
            .isEqualTo(new byte[] {(byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC});
    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)
Back to top