You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
write method of UInt32Writer should has a param of type Long, not integer.
The current version will have a problem when encoding uint32 like 2282200012 (which is beyond the limit of integer).
The text was updated successfully, but these errors were encountered:
public class UInt32Writer implements ScaleWriter<Long> {
private static final long MAX_UINT32 = Long.parseLong("4294967295");
@Override
public void write(ScaleCodecWriter wrt, Long value) throws IOException {
if (value < 0 || value > MAX_UINT32) {
throw new IllegalArgumentException("Only values in range 0.." + MAX_UINT32 + " are supported: " + value);
}
for( int i = 0; i < 4; i++) {
wrt.directWrite(Math.toIntExact((value >> (i * 8)) & 0xff));
}
}
}
write method of UInt32Writer should has a param of type Long, not integer.
The current version will have a problem when encoding uint32 like 2282200012 (which is beyond the limit of integer).
The text was updated successfully, but these errors were encountered: