Class FastCDC
java.lang.Object
utils.FastCDC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachChunk(InputStream inputStream, BiConsumer<byte[], Integer> consumer) Finds all the chunks of a provided input stream and allows the use of a consumer to execute operations on each chunkintgetBreakpoint(byte[] buffer, int length) Gets the next breakpoint of the passed bytes and returns itList<byte[]> getChunks(InputStream inputStream) Performs FastCDC on an InputStream and returns the chunks
-
Constructor Details
-
FastCDC
-
-
Method Details
-
getBreakpoint
public int getBreakpoint(byte[] buffer, int length) Gets the next breakpoint of the passed bytes and returns it- Parameters:
buffer- The bytes to checklength- The length of the buffer- Returns:
- The breakpoint of the passed bytes
-
getChunks
Performs FastCDC on an InputStream and returns the chunks- Parameters:
inputStream- The InputStream to perform CDC on- Returns:
- The found chunks
- Throws:
CDCException- if CDC fails
-
forEachChunk
public void forEachChunk(InputStream inputStream, BiConsumer<byte[], Integer> consumer) throws CDCExceptionFinds all the chunks of a provided input stream and allows the use of a consumer to execute operations on each chunk- Parameters:
inputStream- the to chunkconsumer- the consumer to execute- Throws:
CDCException- if the CDC failed
-