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
l found when the value is negative (e.g. -10000),it will be encode to 0000D8F0.
When decoding, it is calculated as 55536,-10000 need to be encoded to FFFFD8F0
When the value is negative,the buffer need to be filled with 0xff
privatevoidserializeSigned(DataOutputStreamout) throwsIOException {
byte[] val = value.toByteArray();
intsignOctet = 0;
if(val[0] == 0x00 && val.length > 1){
signOctet++;
}
if(isSignedAndBetween(NEGATIVE_TWO_PWR_63, TWO_PWR_63_MINUS_1)){
byte[] buffer = newbyte[getSignedBufferSize()];
// if value is negative buffer need to be filled with 0xffSystem.arraycopy(val, signOctet, buffer, buffer.length - (val.length -signOctet), val.length -signOctet);
out.write(buffer);
}else{
COEREncodeHelper.writeLengthDeterminant(val.length-signOctet, out);
out.write(val, signOctet, val.length -signOctet);
}
}
The text was updated successfully, but these errors were encountered:
Hi,pvendil @pvendil
l found when the value is negative (e.g. -10000),it will be encode to 0000D8F0.
When decoding, it is calculated as 55536,-10000 need to be encoded to FFFFD8F0
When the value is negative,the buffer need to be filled with 0xff
The text was updated successfully, but these errors were encountered: