I want to export a binary format and then I read the binary in Java, But i am not able to get correct values, for example
f.write(struct.pack('<f', 21.988))
in Java I have this value: 8.962863E27
I try to send a binary and match the output to ubjson library written in java, at first I use Big-endian mark but does not work, and when I use Little-endian it works like that.
Thanks for any guides.
Edit: some part of library
public JsonValue parse(final DataInputStream din) throws IOException {
return parse(din, din.readByte());
}
protected JsonValue parse(final DataInputStream din, final byte type) throws IOException {
if (type == '[')
return parseArray(din);
else if (type == '{')
return parseObject(din);
else if (type == 'Z')
return new JsonValue(JsonValue.ValueType.nullValue);
else if (type == 'T')
return new JsonValue(true);
else if (type == 'F')
.....