本文整理汇总了Java中gnu.trove.list.array.TByteArrayList类的典型用法代码示例。如果您正苦于以下问题:Java TByteArrayList类的具体用法?Java TByteArrayList怎么用?Java TByteArrayList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TByteArrayList类属于gnu.trove.list.array包,在下文中一共展示了TByteArrayList类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TByteArrayStack
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
/**
* Creates a new <code>TByteArrayStack</code> instance that is
* a copy of the instanced passed to us.
*
* @param stack the instance to copy
*/
public TByteArrayStack( TByteStack stack ) {
if ( stack instanceof TByteArrayStack ) {
TByteArrayStack array_stack = ( TByteArrayStack ) stack;
this._list = new TByteArrayList( array_stack._list );
} else {
throw new UnsupportedOperationException( "Only support TByteArrayStack" );
}
}
示例2: readExternal
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// LIST
_list = ( TByteArrayList ) in.readObject();
}
示例3: readExternal
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
@Override
public void readExternal( ObjectInput in )
throws IOException, ClassNotFoundException {
// VERSION
in.readByte();
// LIST
_list = ( TByteArrayList ) in.readObject();
}
示例4: serialize
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
@Override
public void serialize(@NonNull TByteArrayList value, JsonGenerator gen,
SerializerProvider serializers) throws IOException {
gen.writeStartObject();
List<Integer> values = new ArrayList<>();
value.forEach(b -> values.add((int) b));
gen.writeObjectField("values", values);
gen.writeEndObject();
}
示例5: ReadBooleanRegistersResponse
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
public ReadBooleanRegistersResponse(int transectionId, int unitId, ModbusRegisterType registerType,
int startingAddress, boolean[] values) {
super(transectionId, unitId, registerType, startingAddress);
this.values = new TByteArrayList(values.length);
quantity = values.length;
for (boolean v : values) {
this.values.add((byte) (v ? 1 : 0));
}
}
示例6: deserialize
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
@Override
public EntityData.Value deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
EntityData.Value.Builder value = EntityData.Value.newBuilder();
if (json.isJsonPrimitive()) {
extractPrimitive(value, json);
} else if (json.isJsonObject()) {
extractMap(json, context, value);
} else if (json.isJsonArray()) {
JsonArray jsonArray = json.getAsJsonArray();
TByteList byteList = new TByteArrayList();
for (JsonElement element : jsonArray) {
if (element.isJsonArray()) {
value.addValue((EntityData.Value) context.deserialize(element, EntityData.Value.class));
} else if (json.isJsonObject()) {
extractMap(json, context, value);
} else if (element.isJsonPrimitive()) {
extractPrimitive(value, element);
if (element.getAsJsonPrimitive().isNumber()) {
try {
byteList.add(element.getAsByte());
} catch (NumberFormatException nfe) {
}
}
}
}
value.setBytes(ByteString.copyFrom(byteList.toArray()));
}
return value.build();
}
示例7: getPhredScores
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
@SuppressWarnings("null")
private @NonNull TByteArrayList getPhredScores() {
allocateBasePhredQualityArray();
return phredScores;
}
示例8: fill
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
private void fill(TByteArrayList type, TurboList<FailCounter> counters, int b)
{
int n = counters.size() - type.size();
Utils.log("Type %d = %d", b, n);
type.fill(type.size(), counters.size(), (byte)b);
}
示例9: AutoDeltaByteVector
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
public AutoDeltaByteVector() {
this.commands = new ArrayList<>(5);
this.v = new TByteArrayList();
this.baselineCommandCount = 0;
}
示例10: AutoDeltaBoolVector
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
public AutoDeltaBoolVector() {
this.commands = new ArrayList<>(5);
this.v = new TByteArrayList();
this.baselineCommandCount = 0;
}
示例11: serialize
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
public EntityData.Value serialize(Iterable<Byte> value) {
TByteArrayList bytes = new TByteArrayList();
bytes.addAll(Lists.newArrayList(value));
ByteString byteString = ByteString.copyFrom(bytes.toArray(new byte[bytes.size()]));
return EntityData.Value.newBuilder().setBytes(byteString).build();
}
示例12: clear
import gnu.trove.list.array.TByteArrayList; //导入依赖的package包/类
/**
* Erases the contents of this buffer and sets its
* length to zero.
*/
public void clear() {
values = new TByteArrayList();
}