Package org.apache.hadoop.io.erasurecode
Class ECChunk
java.lang.Object
org.apache.hadoop.io.erasurecode.ECChunk
A wrapper for ByteBuffer or bytes array for an erasure code chunk.
-
Constructor Summary
ConstructorsConstructorDescriptionECChunk(byte[] buffer) Wrapping a bytes arrayECChunk(byte[] buffer, int offset, int len) ECChunk(ByteBuffer buffer) Wrapping a ByteBufferECChunk(ByteBuffer buffer, int offset, int len) -
Method Summary
Modifier and TypeMethodDescriptionConvert to ByteBufferbooleanvoidsetAllZero(boolean allZero) static ByteBuffer[]Convert an array of this chunks to an array of ByteBuffersbyte[]Convert to a bytes array, just for test usage.
-
Constructor Details
-
ECChunk
Wrapping a ByteBuffer- Parameters:
buffer- buffer to be wrapped by the chunk
-
ECChunk
-
ECChunk
public ECChunk(byte[] buffer) Wrapping a bytes array- Parameters:
buffer- buffer to be wrapped by the chunk
-
ECChunk
public ECChunk(byte[] buffer, int offset, int len)
-
-
Method Details
-
isAllZero
public boolean isAllZero() -
setAllZero
public void setAllZero(boolean allZero) -
getBuffer
Convert to ByteBuffer- Returns:
- ByteBuffer
-
toBuffers
Convert an array of this chunks to an array of ByteBuffers- Parameters:
chunks- chunks to convert into buffers- Returns:
- an array of ByteBuffers
-
toBytesArray
public byte[] toBytesArray()Convert to a bytes array, just for test usage.- Returns:
- bytes array
-