Package com.yahoo.vespa.filedistribution
Class FileReferenceDataBlob
- java.lang.Object
-
- com.yahoo.vespa.filedistribution.FileReferenceData
-
- com.yahoo.vespa.filedistribution.FileReferenceDataBlob
-
public class FileReferenceDataBlob extends FileReferenceData
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.vespa.filedistribution.FileReferenceData
FileReferenceData.Type
-
-
Constructor Summary
Constructors Constructor Description FileReferenceDataBlob(com.yahoo.config.FileReference fileReference, java.lang.String filename, FileReferenceData.Type type, byte[] content)
FileReferenceDataBlob(com.yahoo.config.FileReference fileReference, java.lang.String filename, FileReferenceData.Type type, byte[] content, long xxhash)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close underlying filesjava.nio.ByteBuffer
content()
static FileReferenceData
empty(com.yahoo.config.FileReference fileReference, java.lang.String filename)
int
nextContent(java.nio.ByteBuffer bb)
Will provide the next part of the content.long
size()
The size of the content in byteslong
xxhash()
Only guaranteed to be valid after all content has been consumed.-
Methods inherited from class com.yahoo.vespa.filedistribution.FileReferenceData
filename, fileReference, type
-
-
-
-
Constructor Detail
-
FileReferenceDataBlob
public FileReferenceDataBlob(com.yahoo.config.FileReference fileReference, java.lang.String filename, FileReferenceData.Type type, byte[] content)
-
FileReferenceDataBlob
public FileReferenceDataBlob(com.yahoo.config.FileReference fileReference, java.lang.String filename, FileReferenceData.Type type, byte[] content, long xxhash)
-
-
Method Detail
-
empty
public static FileReferenceData empty(com.yahoo.config.FileReference fileReference, java.lang.String filename)
-
content
public java.nio.ByteBuffer content()
- Overrides:
content
in classFileReferenceData
-
nextContent
public int nextContent(java.nio.ByteBuffer bb)
Description copied from class:FileReferenceData
Will provide the next part of the content.- Specified by:
nextContent
in classFileReferenceData
- Parameters:
bb
- with some available space- Returns:
- Number of bytes transferred.
-
xxhash
public long xxhash()
Description copied from class:FileReferenceData
Only guaranteed to be valid after all content has been consumed.- Specified by:
xxhash
in classFileReferenceData
- Returns:
- xx64hash of content
-
size
public long size()
Description copied from class:FileReferenceData
The size of the content in bytes- Specified by:
size
in classFileReferenceData
- Returns:
- number of bytes
-
close
public void close()
Description copied from class:FileReferenceData
Close underlying files- Specified by:
close
in classFileReferenceData
-
-