List of usage examples for java.math BigInteger setBit
public BigInteger setBit(int n)
From source file:org.openhab.binding.ulux.internal.ump.messages.InitMessage.java
@Override protected void addData(final ByteBuffer buffer) { BigInteger initFlags = BigInteger.valueOf(0); if (this.reset) { initFlags = initFlags.setBit(15); initFlags = initFlags.setBit(14); initFlags = initFlags.setBit(13); initFlags = initFlags.setBit(12); }/* ww w.ja va2 s.c o m*/ if (this.initRequest) { initFlags = initFlags.setBit(6); } if (this.timeRequest) { initFlags = initFlags.setBit(5); } buffer.putShort(initFlags.shortValue()); buffer.putShort((short) 0x5AA5); }