本文整理汇总了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);
}