Исправление цикличных резерваций при записи
All checks were successful
Build rosetta-wss / build (push) Successful in 1m46s
All checks were successful
Build rosetta-wss / build (push) Successful in 1m46s
This commit is contained in:
@@ -28,14 +28,16 @@ public class Stream {
|
|||||||
public void writeInt8(int value) {
|
public void writeInt8(int value) {
|
||||||
int negationBit = value < 0 ? 1 : 0;
|
int negationBit = value < 0 ? 1 : 0;
|
||||||
int int8Value = Math.abs(value) & 0xFF;
|
int int8Value = Math.abs(value) & 0xFF;
|
||||||
|
/**
|
||||||
ensureCapacity(writePointer >> 3);
|
* 1 sign
|
||||||
|
* 8 bits for value
|
||||||
|
*/
|
||||||
|
reserveBits(9);
|
||||||
stream[writePointer >> 3] |= (byte) (negationBit << (7 - (writePointer & 7)));
|
stream[writePointer >> 3] |= (byte) (negationBit << (7 - (writePointer & 7)));
|
||||||
writePointer++;
|
writePointer++;
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
int bit = (int8Value >> (7 - i)) & 1;
|
int bit = (int8Value >> (7 - i)) & 1;
|
||||||
ensureCapacity(writePointer >> 3);
|
|
||||||
stream[writePointer >> 3] |= (byte) (bit << (7 - (writePointer & 7)));
|
stream[writePointer >> 3] |= (byte) (bit << (7 - (writePointer & 7)));
|
||||||
writePointer++;
|
writePointer++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user