Top Description Methods
com.google.common.io

public Interface ByteProcessor<T extends @Nullable Object>

Annotations
@DoNotMock:Implement it normally
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtIncompatible, .J2ktIncompatible, com.google.errorprone.annotations.CanIgnoreReturnValue, .DoNotMock, java.io.IOException, org.checkerframework.checker.nullness.qual.Nullable

A callback interface to process bytes from a stream.

processBytes will be called for each chunk of data that is read, and should return false when you want to stop processing.

Author
Chris Nokleberg
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public T
getResult()

Return the result of processing all the bytes.

public boolean

Returns:

true to continue processing, false to stop
processBytes
(byte[]
the byte array containing the data to process
buf
,
int
the initial offset into the array
off
,
int
the length of data to be processed
len
)

This method will be called for each chunk of bytes in an input stream.

Method Detail

getResultback to summary
public T getResult()

Return the result of processing all the bytes.

Annotations
@ParametricNullness
processBytesback to summary
public boolean processBytes(byte[] buf, int off, int len) throws IOException

This method will be called for each chunk of bytes in an input stream. The implementation should process the bytes from buf[off] through buf[off + len - 1] (inclusive).

Parameters
buf:byte[]

the byte array containing the data to process

off:int

the initial offset into the array

len:int

the length of data to be processed

Returns:boolean

true to continue processing, false to stop

Annotations
@CanIgnoreReturnValue