本文整理匯總了Java中com.esotericsoftware.kryo.io.Output.writeFloat方法的典型用法代碼示例。如果您正苦於以下問題:Java Output.writeFloat方法的具體用法?Java Output.writeFloat怎麽用?Java Output.writeFloat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.esotericsoftware.kryo.io.Output
的用法示例。
在下文中一共展示了Output.writeFloat方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write (Kryo kryo, Output output, ObjectFloatMap map) {
int length = map.size;
output.writeVarInt(length, true);
output.writeBoolean(false); // whether type is written (in case future version of ObjectFloatMap supports type awareness)
Serializer keySerializer = null;
if (keyGenericType != null) {
if (keySerializer == null) keySerializer = kryo.getSerializer(keyGenericType);
keyGenericType = null;
}
for (Iterator iter = map.iterator(); iter.hasNext();) {
ObjectFloatMap.Entry entry = (ObjectFloatMap.Entry)iter.next();
if (keySerializer != null) {
kryo.writeObject(output, entry.key, keySerializer);
} else
kryo.writeClassAndObject(output, entry.key);
output.writeFloat(entry.value);
}
}
示例2: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
public void write(Kryo kryo, Output output, MapMetaData<Float> object) {
try {
List<Map<String, Float>> mapDataList = mapMetaData.getMapDataList();
mapMetaData.send(output);
int mapSegNum = mapMetaData.getSegNum();
for (int i = 0; i < mapSegNum; i++) {
Map<String, Float> mapData = mapDataList.get(i);
for (Map.Entry<String, Float> entry : mapData.entrySet()) {
output.writeString(entry.getKey());
output.writeFloat(entry.getValue());
}
if (mapMetaData.getCollective() == Collective.GATHER ||
mapMetaData.getCollective() == Collective.SCATTER ||
mapMetaData.getCollective() == Collective.REDUCE_SCATTER) {
mapData.clear();
}
}
} catch (IOException e) {
LOG.error("double array write exception", e);
System.exit(1);
}
}
示例3: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, BoundingBox boundingBox) {
Vector3 min = boundingBox.min;
output.writeFloat(min.x);
output.writeFloat(min.y);
output.writeFloat(min.z);
Vector3 max = boundingBox.max;
output.writeFloat(max.x);
output.writeFloat(max.y);
output.writeFloat(max.z);
}
示例4: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Ray ray) {
Vector3 origin = ray.origin;
output.writeFloat(origin.x);
output.writeFloat(origin.y);
output.writeFloat(origin.z);
Vector3 direction = ray.direction;
output.writeFloat(direction.x);
output.writeFloat(direction.y);
output.writeFloat(direction.z);
}
示例5: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Segment segment) {
Vector3 a = segment.a;
output.writeFloat(a.x);
output.writeFloat(a.y);
output.writeFloat(a.z);
Vector3 b = segment.b;
output.writeFloat(b.x);
output.writeFloat(b.y);
output.writeFloat(b.z);
}
示例6: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write (Kryo kryo, Output output, Polyline polyline) {
output.writeInt(polyline.getVertices().length);
output.writeFloats(polyline.getVertices());
output.writeFloat(polyline.getX());
output.writeFloat(polyline.getY());
output.writeFloat(polyline.getOriginX());
output.writeFloat(polyline.getOriginY());
output.writeFloat(polyline.getRotation());
output.writeFloat(polyline.getScaleX());
output.writeFloat(polyline.getScaleY());
}
示例7: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, SplitInfo object) {
output.writeFloat(object.lossChg);
output.writeInt(object.splitIndex);
output.writeFloat(object.splitValue);
output.writeInt(object.splitSlotInterval.length);
for (int i = 0; i < object.splitSlotInterval.length; i++) {
output.writeInt(object.splitSlotInterval[i]);
}
}
示例8: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Quaternion quaternion) {
output.writeFloat(quaternion.x);
output.writeFloat(quaternion.y);
output.writeFloat(quaternion.z);
output.writeFloat(quaternion.w);
}
示例9: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, FloatCounter floatCounter) {
kryo.writeObjectOrNull(output, floatCounter.mean, WindowedMean.class);
output.writeInt(floatCounter.count);
output.writeFloat(floatCounter.total);
output.writeFloat(floatCounter.min);
output.writeFloat(floatCounter.max);
output.writeFloat(floatCounter.average);
output.writeFloat(floatCounter.latest);
output.writeFloat(floatCounter.value);
}
示例10: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Ellipse ellipse) {
output.writeFloat(ellipse.x);
output.writeFloat(ellipse.y);
output.writeFloat(ellipse.width);
output.writeFloat(ellipse.height);
}
示例11: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Plane plane) {
Vector3 normal = plane.normal;
output.writeFloat(normal.x);
output.writeFloat(normal.y);
output.writeFloat(normal.z);
output.writeFloat(plane.d);
}
示例12: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Affine2 affine2) {
output.writeFloat(affine2.m00);
output.writeFloat(affine2.m01);
output.writeFloat(affine2.m02);
output.writeFloat(affine2.m10);
output.writeFloat(affine2.m11);
output.writeFloat(affine2.m12);
}
示例13: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write (Kryo kryo, Output output, PerspectiveCamera camera) {
kryo.writeObject(output, camera.position);
kryo.writeObject(output, camera.direction);
kryo.writeObject(output, camera.up);
output.writeFloat(camera.near);
output.writeFloat(camera.far);
output.writeFloat(camera.viewportWidth);
output.writeFloat(camera.viewportHeight);
output.writeFloat(camera.fieldOfView);
}
示例14: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Summary object) {
output.writeInt(object.value.length);
for (int i = 0; i < object.value.length; i++) {
output.writeFloat(object.value[i]);
}
output.writeInt(object.rmin.length);
for (int i = 0; i < object.rmin.length; i++) {
output.writeDouble(object.rmin[i]);
}
output.writeInt(object.rmax.length);
for (int i = 0; i < object.rmax.length; i++) {
output.writeDouble(object.rmax[i]);
}
output.writeInt(object.w.length);
for (int i = 0; i < object.w.length; i++) {
output.writeFloat(object.w[i]);
}
output.writeInt(object.capacity);
output.writeInt(object.cursor);
output.writeDouble(object.B);
output.writeBoolean(object.exact);
output.writeDouble(object.eps);
}
示例15: write
import com.esotericsoftware.kryo.io.Output; //導入方法依賴的package包/類
@Override
public void write(Kryo kryo, Output output, Color color) {
Boolean compact = GraphHeader.isUseCompactColor(kryo);
if (compact == null) compact = isCompactDefault;
if (compact){
output.writeInt(Color.rgba8888(color));
} else {
output.writeFloat(color.r);
output.writeFloat(color.g);
output.writeFloat(color.b);
output.writeFloat(color.a);
}
}