Chunker
  public
  
  final
  
  class
  Chunker
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | com.android.tradefed.cache.remote.Chunker | 
Splits a blob into one or more Chunks of at most chunkSize bytes.
 
After blob has been fully consumed, that is until hasNext() returns false, the chunker closes the underlying data source (i.e. file) itself.
Summary
| Nested classes | |
|---|---|
| 
        
        
        
        
        class | Chunker.ChunkA piece of a blob. | 
| Public constructors | |
|---|---|
| 
      Chunker(InputStream blob, long size, int chunkSize)
       | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        boolean | 
      hasNext()
      Returns  | 
| 
        
        
        
        
        
        Chunker.Chunk | 
      next()
      Returns the next  | 
Public constructors
Chunker
public Chunker (InputStream blob, 
                long size, 
                int chunkSize)| Parameters | |
|---|---|
| blob | InputStream | 
| size | long | 
| chunkSize | int | 
Public methods
hasNext
public boolean hasNext ()
Returns true if a subsequent call to next() returns a Chunk object.
| Returns | |
|---|---|
| boolean | |
next
public Chunker.Chunk next ()
Returns the next Chunk or throws a ERROR(/NoSuchElementException) if no data is left.
 
Always call hasNext() before calling this method.
 
Zero byte inputs are treated special. Instead of throwing a ERROR(/NoSuchElementException)
 on the first call to next(), a Chunk with an empty ByteString is
 returned.
| Returns | |
|---|---|
| Chunker.Chunk | |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-07-02 UTC.
