Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for realBytes (8.39 sec)

  1. android/guava-tests/test/com/google/common/base/Utf8Test.java

        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;
      }
    
      private static void assertWellFormed(int... bytes) {
        assertTrue(Utf8.isWellFormed(toByteArray(bytes)));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/base/Utf8Test.java

        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;
      }
    
      private static void assertWellFormed(int... bytes) {
        assertTrue(Utf8.isWellFormed(toByteArray(bytes)));
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Feb 09 15:49:48 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

          return super.skip(Math.min(max, n));
        }
      }
    
      public void testReadBytes() throws IOException {
        final byte[] array = newPreFilledByteArray(1000);
        assertThat(ByteStreams.readBytes(new ByteArrayInputStream(array), new TestByteProcessor()))
            .isEqualTo(array);
      }
    
      private static class TestByteProcessor implements ByteProcessor<byte[]> {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/io/FilesTest.java

              @Override
              public byte[] getResult() {
                return out.toByteArray();
              }
            };
    
        File asciiFile = getTestFile("ascii.txt");
        byte[] result = Files.readBytes(asciiFile, processor);
        assertEquals(Bytes.asList(Files.toByteArray(asciiFile)), Bytes.asList(result));
      }
    
      public void testReadBytes_returnFalse() throws IOException {
        ByteProcessor<byte[]> processor =
    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)
  5. src/main/java/org/codelibs/core/io/FileUtil.java

            }
        }
    
        /**
         * ファイルの内容をバイト配列に読み込んで返します。
         *
         * @param file
         *            ファイル。{@literal null}であってはいけません
         * @return ファイルの内容を読み込んだバイト配列
         */
        public static byte[] readBytes(final File file) {
            assertArgumentNotNull("file", file);
    
            final FileInputStream is = InputStreamUtil.create(file);
            try {
                final FileChannel channel = is.getChannel();
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

        try {
          byte[] readBytes = ByteStreams.toByteArray(in);
          assertExpectedBytes(readBytes);
        } finally {
          in.close();
        }
      }
    
      public void testOpenBufferedStream() throws IOException {
        InputStream in = source.openBufferedStream();
        try {
          byte[] readBytes = ByteStreams.toByteArray(in);
          assertExpectedBytes(readBytes);
        } finally {
          in.close();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/ByteSource.java

        checkNotNull(processor);
    
        Closer closer = Closer.create();
        try {
          InputStream in = closer.register(openStream());
          return ByteStreams.readBytes(in, processor);
        } catch (Throwable e) {
          throw closer.rethrow(e);
        } finally {
          closer.close();
        }
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 26.2K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/io/ByteStreams.java

       * @throws IOException if an I/O error occurs
       * @since 14.0
       */
      @CanIgnoreReturnValue // some processors won't return a useful result
      @ParametricNullness
      public static <T extends @Nullable Object> T readBytes(
          InputStream input, ByteProcessor<T> processor) throws IOException {
        checkNotNull(input);
        checkNotNull(processor);
    
        byte[] buf = createBuffer();
        int read;
        do {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jan 17 18:59:58 GMT 2024
    - 29.7K bytes
    - Viewed (0)
  9. src/main/java/org/codelibs/fess/app/web/admin/design/AdminDesignAction.java

        public HtmlResponse edit(final EditForm form) {
            final String jspType = "view";
            final File jspFile = getJspFile(form.fileName, jspType);
            try {
                form.content = new String(FileUtil.readBytes(jspFile), Constants.UTF_8);
            } catch (final UnsupportedEncodingException e) {
                throw new FessSystemException("Invalid encoding", e);
            }
            saveToken();
            return asEditHtml(form);
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 15.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/io/ByteSourceTester.java

        try {
          byte[] readBytes = ByteStreams.toByteArray(in);
          assertExpectedBytes(readBytes);
        } finally {
          in.close();
        }
      }
    
      public void testOpenBufferedStream() throws IOException {
        InputStream in = source.openBufferedStream();
        try {
          byte[] readBytes = ByteStreams.toByteArray(in);
          assertExpectedBytes(readBytes);
        } finally {
          in.close();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
Back to top