private void serializeFloat(DataOutput out, Object obj) throws IOException {
        float v = (Float) obj;
        if (v == -1f)
            out.write(Header.FLOAT_M1);
        else if (v == 0f)
            out.write(Header.FLOAT_0);
        else if (v == 1f)
            out.write(Header.FLOAT_1);
        else if (v >= 0 && v <= 255 && (int) v == v) {
            out.write(Header.FLOAT_255);
            out.write((int) v);
        } else if (v >= Short.MIN_VALUE && v <= Short.MAX_VALUE && (short) v == v) {
            out.write(Header.FLOAT_SHORT);
            out.writeShort((int) v);
        } else {
            out.write(Header.FLOAT);
            out.writeFloat(v);
        }
        return;
    }