mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Align doubles to 8 bytes in the StandardMessageCodec (#3779)
See https://github.com/flutter/flutter/issues/10701
This commit is contained in:
parent
f741647d49
commit
ab2bc15fcc
@ -192,6 +192,7 @@ public final class StandardMessageCodec implements MessageCodec<Object> {
|
||||
writeLong(stream, (long) value);
|
||||
} else if (value instanceof Float || value instanceof Double) {
|
||||
stream.write(DOUBLE);
|
||||
writeAlignment(stream, 8);
|
||||
writeDouble(stream, ((Number) value).doubleValue());
|
||||
} else if (value instanceof BigInteger) {
|
||||
stream.write(BIGINT);
|
||||
@ -305,6 +306,7 @@ public final class StandardMessageCodec implements MessageCodec<Object> {
|
||||
break;
|
||||
}
|
||||
case DOUBLE:
|
||||
readAlignment(buffer, 8);
|
||||
result = buffer.getDouble();
|
||||
break;
|
||||
case STRING: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user