本文整理匯總了Java中org.apache.kylin.common.util.BytesUtil.readByteArray方法的典型用法代碼示例。如果您正苦於以下問題:Java BytesUtil.readByteArray方法的具體用法?Java BytesUtil.readByteArray怎麽用?Java BytesUtil.readByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.kylin.common.util.BytesUtil
的用法示例。
在下文中一共展示了BytesUtil.readByteArray方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deserialize
import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public List<ByteArray> deserialize(ByteBuffer in) {
List<ByteArray> values = new ArrayList<>();
int size = BytesUtil.readVInt(in);
if (size >= 0) {
for (int i = 0; i < size; i++) {
ByteArray ba = new ByteArray(BytesUtil.readByteArray(in));
if (ba.length() != 0) {
values.add(ba);
}
}
} else {
throw new RuntimeException("Read error data size:" + size);
}
return values;
}
示例2: readDimensionEncoding
import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
private static DimensionEncoding readDimensionEncoding(ByteBuffer in) {
try {
int isNull = BytesUtil.readVInt(in);
if (isNull == 1) {
return null;
}
byte[] bytes = BytesUtil.readByteArray(in);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bais);
DimensionEncoding ret = (DimensionEncoding) ois.readObject();
return ret;
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
示例3: deserialize
import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public ByteArray deserialize(ByteBuffer in) {
//the array in ByteArray is garanteed to be completed owned by the ByteArray
return new ByteArray(BytesUtil.readByteArray(in));
}
示例4: deserialize
import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public CoprocessorProjector deserialize(ByteBuffer in) {
byte[] mask = BytesUtil.readByteArray(in);
boolean hasGroupBy = BytesUtil.readVInt(in) == 1;
return new CoprocessorProjector(mask, hasGroupBy);
}