@Override public void writeFloat(float v) throws IOException { dos.writeFloat(v); }
@Override public void writeFloat(float v) throws IOException { dos.writeFloat(v); }
@Override public final void writeFloat(float v) throws IOException { out.writeFloat(v); }
public final void writeFloat (float v) throws IOException { dos.writeFloat(v); }
public final void writeFloat (float v) throws IOException { dos.writeFloat(v); }
@Override public final void writeFloat(float v) throws IOException { out.writeFloat(v); }
/** * Write a float. * * @param i the value * @return itself */ private Transfer writeFloat(float i) throws IOException { out.writeFloat(i); return this; }
@Override public final void writeFloat(float v) throws IOException { out.writeFloat(v); }
public void write(DataOutputStream out) throws IOException { out.writeByte(tag); out.writeFloat(value); }
@Override public void write(DataOutputStream out) throws IOException { out.writeByte(tag); out.writeFloat(value); }
/** Appends a {@code float} value to the stream. This corresponds to the {@code float32} value type in the UBJSON specification. * @return this writer, for chaining */ public UBJsonWriter value (float value) throws IOException { checkName(); out.writeByte('d'); out.writeFloat(value); return this; }
/** Appends a {@code float} value to the stream. This corresponds to the {@code float32} value type in the UBJSON specification. * @return this writer, for chaining */ public UBJsonWriter value (float value) throws IOException { checkName(); out.writeByte('d'); out.writeFloat(value); return this; }
private void writeFloat32(DataOutputStream output, Float f) throws IOException { if(f == null) output.writeFloat(Float.MIN_VALUE); else if(f.floatValue() == Float.MIN_VALUE) throw new SerializationException("Underflow: attempt to store " + Float.MIN_VALUE + " in float32, but that value is reserved for null."); else output.writeFloat(f.floatValue()); }
public void setColumn(int colId, @Nonnull float[] values) throws IOException { _currentRowDataByteBuffer.position(_columnOffsets[colId]); _currentRowDataByteBuffer.putInt(_variableSizeDataByteArrayOutputStream.size()); _currentRowDataByteBuffer.putInt(values.length); for (float value : values) { _variableSizeDataOutputStream.writeFloat(value); } }
public void sendUpdate () { synchronized (this) { if (!connected) return; } try { out.writeInt(ACCEL); out.writeFloat(Gdx.input.getAccelerometerX()); out.writeFloat(Gdx.input.getAccelerometerY()); out.writeFloat(Gdx.input.getAccelerometerZ()); out.writeInt(COMPASS); out.writeFloat(Gdx.input.getAzimuth()); out.writeFloat(Gdx.input.getPitch()); out.writeFloat(Gdx.input.getRoll()); out.writeInt(SIZE); out.writeFloat(Gdx.graphics.getWidth()); out.writeFloat(Gdx.graphics.getHeight()); out.writeInt(GYRO); out.writeFloat(Gdx.input.getGyroscopeX()); out.writeFloat(Gdx.input.getGyroscopeY()); out.writeFloat(Gdx.input.getGyroscopeZ()); } catch (Throwable t) { out = null; connected = false; } }
public void sendUpdate () { synchronized (this) { if (!connected) return; } try { out.writeInt(ACCEL); out.writeFloat(Gdx.input.getAccelerometerX()); out.writeFloat(Gdx.input.getAccelerometerY()); out.writeFloat(Gdx.input.getAccelerometerZ()); out.writeInt(COMPASS); out.writeFloat(Gdx.input.getAzimuth()); out.writeFloat(Gdx.input.getPitch()); out.writeFloat(Gdx.input.getRoll()); out.writeInt(SIZE); out.writeFloat(Gdx.graphics.getWidth()); out.writeFloat(Gdx.graphics.getHeight()); out.writeInt(GYRO); out.writeFloat(Gdx.input.getGyroscopeX()); out.writeFloat(Gdx.input.getGyroscopeY()); out.writeFloat(Gdx.input.getGyroscopeZ()); } catch (Throwable t) { out = null; connected = false; } }
/** Appends an optimized {@code float array} value to the stream. As an optimized array, the {@code float32} value type marker * and element count are encoded once at the array marker instead of repeating the type marker for each element. * @return this writer, for chaining */ public UBJsonWriter value (float[] values) throws IOException { array(); out.writeByte('$'); out.writeByte('d'); out.writeByte('#'); value(values.length); for (int i = 0, n = values.length; i < n; i++) { out.writeFloat(values[i]); } pop(true); return this; }
/** Appends an optimized {@code float array} value to the stream. As an optimized array, the {@code float32} value type marker * and element count are encoded once at the array marker instead of repeating the type marker for each element. * @return this writer, for chaining */ public UBJsonWriter value (float[] values) throws IOException { array(); out.writeByte('$'); out.writeByte('d'); out.writeByte('#'); value(values.length); for (int i = 0, n = values.length; i < n; i++) { out.writeFloat(values[i]); } pop(true); return this; }
private void initializeData(DataOutputStream out) throws IOException { /* Write out various test values NORMALLY */ out.write(new byte[] {-100, 100}); out.writeBoolean(true); out.writeBoolean(false); out.writeByte(100); out.writeByte(-100); out.writeByte((byte) 200); out.writeChar('a'); out.writeShort((short) -30000); out.writeShort((short) 50000); out.writeInt(0xCAFEBABE); out.writeLong(0xDEADBEEFCAFEBABEL); out.writeUTF("Herby Derby"); out.writeFloat(Float.intBitsToFloat(0xCAFEBABE)); out.writeDouble(Double.longBitsToDouble(0xDEADBEEFCAFEBABEL)); }
@Override public void save(DataOutputStream out) throws IOException { if (!(featureMap instanceof ImmutableFeatureMDatMap)) { featureMap = new ImmutableFeatureMDatMap(featureMap.entrySet(), tagSet()); } featureMap.save(out); for (float aParameter : this.parameter) { out.writeFloat(aParameter); } }