Encodes the given Boolean object into exactly 1 byte for descending
order.

@param value optional Boolean value to encode
@param dst destination for encoded bytes
@param dstOffset offset into destination array
194146
public static void encodeDesc(Boolean value, byte[] dst, int dstOffset) {
        if (value == null) {
            dst[dstOffset] = NULL_BYTE_LOW;
        } else {
            dst[dstOffset] = value.booleanValue() ? (byte)127 : (byte)128;
        }
    }
621164
public static void encode(Appendable out, int value)
      throws IOException {
    value = toVLQSigned(value);
    do {
      int digit = value & VLQ_BASE_MASK;
      value >>>= VLQ_BASE_SHIFT;
      if (value > 0) {
        digit |= VLQ_CONTINUATION_BIT;
      }
      out.append(Base64.toBase64(digit));
    } while (value > 0);
  }
383964
private void writeByte(int value) throws IOException {
    if (this.msb0) {
      value = JBBPUtils.reverseBitsInByte((byte) value) & 0xFF;
    }
    this.out.write(value);
    this.byteCounter++;
  }
343080
public static boolean toBoolean(Object value, EvaluationContext ctx) {
        if (value instanceof Boolean) {
            return (Boolean) value;
        }
        else if (value instanceof Integer) {
            return ((Integer) value) != 0;
        }
        else if (value instanceof BigDecimal) {
            return !value.equals(BigDecimal.ZERO);
        }
        else if (value instanceof String) {
            String strVal = (String) value;
            if (strVal.equalsIgnoreCase("TRUE")) {
                return true;
            }  else if (strVal.equalsIgnoreCase("FALSE")) {
                return false;
            }
        }
        else if (value instanceof LocalDate || value instanceof OffsetTime || value instanceof ZonedDateTime) {
            return true;
        }

        throw new EvaluationError("Can't convert '" + value + "' to a boolean");
    }
885103
static void longToBase16String(long value, char[] dest, int destOffset) {
    byteToBase16((byte) (value >> 56 & 0xFFL), dest, destOffset);
    byteToBase16((byte) (value >> 48 & 0xFFL), dest, destOffset + BYTE_BASE16);
    byteToBase16((byte) (value >> 40 & 0xFFL), dest, destOffset + 2 * BYTE_BASE16);
    byteToBase16((byte) (value >> 32 & 0xFFL), dest, destOffset + 3 * BYTE_BASE16);
    byteToBase16((byte) (value >> 24 & 0xFFL), dest, destOffset + 4 * BYTE_BASE16);
    byteToBase16((byte) (value >> 16 & 0xFFL), dest, destOffset + 5 * BYTE_BASE16);
    byteToBase16((byte) (value >> 8 & 0xFFL), dest, destOffset + 6 * BYTE_BASE16);
    byteToBase16((byte) (value & 0xFFL), dest, destOffset + 7 * BYTE_BASE16);
  }
1115227
public static boolean valueOf(String value) {
        return (value != null) && (value.trim().equalsIgnoreCase("true") || value.trim().equals("1"));
    }
277332
public synchronized int setNext(boolean value) {
    int previousValue = -1;
    if (occupiedBits < size)
      occupiedBits++;
    else
      previousValue = bitSet.get(nextIndex) ? 1 : 0;

    bitSet.set(nextIndex, value);
    nextIndex = indexAfter(nextIndex);

    if (value) {
      if (previousValue != 1)
        positives++;
      if (previousValue == 0)
        negatives--;
    } else {
      if (previousValue != 0)
        negatives++;
      if (previousValue == 1)
        positives--;
    }

    return previousValue;
  }
808944
public void setShort(int offset, int value)
  {
    byte []code = getCode();
    
    code[offset + 0]  = (byte) (value >> 8);
    code[offset + 1]  = (byte) (value);
  }
958037
public boolean set(boolean value)
    {
        String prevValue = setString(Boolean.toString(value));
        if (prevValue == null) {
            prevValue = getDefaultValue();
            if (prevValue == null) {
                return false;
            }
        }
        return toBoolean(prevValue);
    }
268433
public static void writeInt(byte[] bytes, int value, int offset) {
        bytes[offset] = (byte) (0xFF & (value >> 24));
        bytes[offset + 1] = (byte) (0xFF & (value >> 16));
        bytes[offset + 2] = (byte) (0xFF & (value >> 8));
        bytes[offset + 3] = (byte) (0xFF & value);
    }
651842
public static void copy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int length) {
		System.arraycopy(src, srcOffset, dst, dstOffset, length);
	}
989736
public static void writeUnsignedShort(byte[] bytes, int value, int offset) {
        bytes[offset] = (byte) (0xFF & (value >> 8));
        bytes[offset + 1] = (byte) (0xFF & value);
    }
1162476
@Override
    public int encode ( byte[] dst, int dstIndex ) {
        if ( this.largeFile ) {
            SMBUtil.writeInt2(this.pid, dst, dstIndex);
            SMBUtil.writeInt4(this.byteOffset >> 32, dst, dstIndex + 4);
            SMBUtil.writeInt4(this.byteOffset & 0xFFFFFFFF, dst, dstIndex + 8);
            SMBUtil.writeInt4(this.lengthInBytes >> 32, dst, dstIndex + 12);
            SMBUtil.writeInt4(this.lengthInBytes & 0xFFFFFFFF, dst, dstIndex + 16);
            return 20;
        }
        SMBUtil.writeInt2(this.pid, dst, dstIndex);
        SMBUtil.writeInt4(this.byteOffset, dst, dstIndex + 2);
        SMBUtil.writeInt4(this.lengthInBytes, dst, dstIndex + 6);
        return 10;
    }
152666
@Override
	public long writeBooleans(boolean value, long count) {
		count = Math.min(count, size - position - bufferSize);
		if (count == 0) return 0;

		final int bits = value ? -1 : 0;
		long c = count;
		while (c >= 32) {
			flushBuffer();
			bufferBits = bits;
			bufferSize = 32;
			c -= 32;
		}

		int d = (int) c;
		if (d == 0) {
			/* do nothing */
		} else if (bufferSize == 0) {
			bufferBits = bits;
			bufferSize = d;
		} else if (bufferSize + d <= 32) {
			bufferBits <<= d;
			if (value) bufferBits |= preMask(d);
			bufferSize += d;
		} else {
			flushBuffer();
			bufferBits = bits;
			bufferSize = d;
		}

		return count;
	}
870761
public void fconst(float value) throws IOException
    {
        if (value == 0 || value == 1 || value == 2)
        {
            super.fconst((int) value);
        }
        else
        {
            ldc(value);
        }
    }
1336822
public void write(GroupAddress dst, float value) throws KNXTimeoutException,
		KNXFormatException, KNXLinkClosedException
	{
		final DPTXlator2ByteFloat t =
			new DPTXlator2ByteFloat(DPTXlator2ByteFloat.DPT_TEMPERATURE_DIFFERENCE);
		t.setValue(value);
		write(dst, priority, t);
	}
644762
public static void intToBytes(int value, byte[] bytes, int offset) {
        bytes[offset + 3] = (byte) (value >>> 0);
        bytes[offset + 2] = (byte) (value >>> 8);
        bytes[offset + 1] = (byte) (value >>> 16);
        bytes[offset + 0] = (byte) (value >>> 24);
    }