Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for processBytes (0.18 sec)

  1. android/guava/src/com/google/common/io/ByteProcessor.java

    import com.google.errorprone.annotations.DoNotMock;
    import java.io.IOException;
    import org.checkerframework.checker.nullness.qual.Nullable;
    
    /**
     * A callback interface to process bytes from a stream.
     *
     * <p>{@link #processBytes} will be called for each chunk of data that is read, and should return
     * {@code false} when you want to stop processing.
     *
     * @author Chris Nokleberg
     * @since 1.0
     */
    @DoNotMock("Implement it normally")
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/ByteStreamsTest.java

      }
    
      private static class TestByteProcessor implements ByteProcessor<byte[]> {
        private final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
        @Override
        public boolean processBytes(byte[] buf, int off, int len) {
          out.write(buf, off, len);
          return true;
        }
    
        @Override
        public byte[] getResult() {
          return out.toByteArray();
        }
      }
    
    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)
  3. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

            source.read(
                new ByteProcessor<byte[]>() {
                  final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
                  @Override
                  public boolean processBytes(byte[] buf, int off, int len) throws IOException {
                    out.write(buf, off, len);
                    return true;
                  }
    
                  @Override
                  public byte[] getResult() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/io/ByteSourceTest.java

        final byte[] processedBytes = new byte[bytes.length];
        ByteProcessor<byte[]> processor =
            new ByteProcessor<byte[]>() {
              int pos;
    
              @Override
              public boolean processBytes(byte[] buf, int off, int len) throws IOException {
                System.arraycopy(buf, off, processedBytes, pos, len);
                pos += len;
                return true;
              }
    
              @Override
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/ByteSourceTest.java

        final byte[] processedBytes = new byte[bytes.length];
        ByteProcessor<byte[]> processor =
            new ByteProcessor<byte[]>() {
              int pos;
    
              @Override
              public boolean processBytes(byte[] buf, int off, int len) throws IOException {
                System.arraycopy(buf, off, processedBytes, pos, len);
                pos += len;
                return true;
              }
    
              @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/ByteSourceTester.java

            source.read(
                new ByteProcessor<byte[]>() {
                  final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
                  @Override
                  public boolean processBytes(byte[] buf, int off, int len) throws IOException {
                    out.write(buf, off, len);
                    return true;
                  }
    
                  @Override
                  public byte[] getResult() {
    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)
  7. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

      }
    
      private static class TestByteProcessor implements ByteProcessor<byte[]> {
        private final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
        @Override
        public boolean processBytes(byte[] buf, int off, int len) {
          out.write(buf, off, len);
          return true;
        }
    
        @Override
        public byte[] getResult() {
          return out.toByteArray();
        }
      }
    
    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)
  8. android/guava-tests/test/com/google/common/io/FilesTest.java

        ByteProcessor<byte[]> processor =
            new ByteProcessor<byte[]>() {
              private final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
              @Override
              public boolean processBytes(byte[] buffer, int offset, int length) throws IOException {
                if (length >= 0) {
                  out.write(buffer, offset, length);
                }
                return true;
              }
    
    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. guava-tests/test/com/google/common/io/FilesTest.java

        ByteProcessor<byte[]> processor =
            new ByteProcessor<byte[]>() {
              private final ByteArrayOutputStream out = new ByteArrayOutputStream();
    
              @Override
              public boolean processBytes(byte[] buffer, int offset, int length) throws IOException {
                if (length >= 0) {
                  out.write(buffer, offset, length);
                }
                return true;
              }
    
    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)
  10. android/guava/src/com/google/common/io/ByteSource.java

        }
    
        @SuppressWarnings("CheckReturnValue") // it doesn't matter what processBytes returns here
        @Override
        @ParametricNullness
        public <T extends @Nullable Object> T read(ByteProcessor<T> processor) throws IOException {
          processor.processBytes(bytes, offset, length);
          return processor.getResult();
        }
    
        @Override
    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)
Back to top