Lines Matching defs:value
20 * of additional bytes. The additional bytes store (abs(value) - 119) as an
40 * The maximum number of bytes needed to store an int value (5).
45 * The maximum number of bytes needed to store a long value (9).
74 int value = buf[off++] & 0xFF;
76 value |= (buf[off++] & 0xFF) << 8;
78 value |= (buf[off++] & 0xFF) << 16;
80 value |= (buf[off++] & 0xFF) << 24;
85 return negative ? (-value - 119) : (value + 119);
113 long value = buf[off++] & 0xFFL;
115 value |= (buf[off++] & 0xFFL) << 8;
117 value |= (buf[off++] & 0xFFL) << 16;
119 value |= (buf[off++] & 0xFFL) << 24;
121 value |= (buf[off++] & 0xFFL) << 32;
123 value |= (buf[off++] & 0xFFL) << 40;
125 value |= (buf[off++] & 0xFFL) << 48;
127 value |= (buf[off++] & 0xFFL) << 56;
136 return negative ? (-value - 119) : (value + 119);
191 * @param value the integer to be written.
195 public static int writeInt(byte[] buf, int offset, int value) {
200 if (value < -119) {
202 value = -value - 119;
203 } else if (value > 119) {
205 value = value - 119;
207 buf[offset++] = (byte) value;
212 buf[offset++] = (byte) value;
213 if ((value & 0xFFFFFF00) == 0) {
218 buf[offset++] = (byte) (value >>> 8);
219 if ((value & 0xFFFF0000) == 0) {
224 buf[offset++] = (byte) (value >>> 16);
225 if ((value & 0xFF000000) == 0) {
230 buf[offset++] = (byte) (value >>> 24);
243 * @param value the long integer to be written.
247 public static int writeLong(byte[] buf, int offset, long value) {
252 if (value < -119) {
254 value = -value - 119;
255 } else if (value > 119) {
257 value = value - 119;
259 buf[offset++] = (byte) value;
264 buf[offset++] = (byte) value;
265 if ((value & 0xFFFFFFFFFFFFFF00L) == 0) {
270 buf[offset++] = (byte) (value >>> 8);
271 if ((value & 0xFFFFFFFFFFFF0000L) == 0) {
276 buf[offset++] = (byte) (value >>> 16);
277 if ((value & 0xFFFFFFFFFF000000L) == 0) {
282 buf[offset++] = (byte) (value >>> 24);
283 if ((value & 0xFFFFFFFF00000000L) == 0) {
288 buf[offset++] = (byte) (value >>> 32);
289 if ((value & 0xFFFFFF0000000000L) == 0) {
294 buf[offset++] = (byte) (value >>> 40);
295 if ((value & 0xFFFF000000000000L) == 0) {
300 buf[offset++] = (byte) (value >>> 48);
301 if ((value & 0xFF00000000000000L) == 0) {
306 buf[offset++] = (byte) (value >>> 56);
314 * @param value the integer to be written.
319 public static int getWriteIntLength(int value) {
321 if (value < -119) {
322 value = -value - 119;
323 } else if (value > 119) {
324 value = value - 119;
329 if ((value & 0xFFFFFF00) == 0) {
332 if ((value & 0xFFFF0000) == 0) {
335 if ((value & 0xFF000000) == 0) {
344 * @param value the long integer to be written.
349 public static int getWriteLongLength(long value) {
351 if (value < -119) {
352 value = -value - 119;
353 } else if (value > 119) {
354 value = value - 119;
359 if ((value & 0xFFFFFFFFFFFFFF00L) == 0) {
362 if ((value & 0xFFFFFFFFFFFF0000L) == 0) {
365 if ((value & 0xFFFFFFFFFF000000L) == 0) {
368 if ((value & 0xFFFFFFFF00000000L) == 0) {
371 if ((value & 0xFFFFFF0000000000L) == 0) {
374 if ((value & 0xFFFF000000000000L) == 0) {
377 if ((value & 0xFF00000000000000L) == 0) {