public static final long setBit(long v, int position, boolean value) { if(value) return v | (1L << position); else return clearBit(v, position); } }
/** * Returns v, with the bit at position set to 1 or 0 depending on value. */ public static final byte setBit(byte v, int position, boolean value) { return (byte)setBit((int)v, position, value); }
/** * Bitfield utilities. * Returns true if the bit at position is set in v. */ public static final boolean testBit(byte v, int position) { return testBit((int)v, position); }
/** * Decode a series of 4 bytes from <code>buf</code>, starting at position 0, * and interpret them as an integer. * * @param buf * The buffer to read from. * @return An integer, as read from the buffer. */ public static final int decodeBigEndian(final byte[] buf) { return decodeBigEndian(buf, 0); }
/** * Encode <code>integer</code> as a series of 4 bytes into <code>buf</code> * starting at position 0 within that buffer. * * @param integer * The integer to encode. * @param buf * The buffer to write to. */ public static final void encodeBigEndian(final int integer, final byte[] buf) { encodeBigEndian(integer, buf, 0); }
/** * Decode a series of 4 bytes from <code>buf</code>, starting at position 0, * and interpret them as an integer. * * @param buf * The buffer to read from. * @return An integer, as read from the buffer. */ public static final int decodeBigEndian(final byte[] buf) { return decodeBigEndian(buf, 0); }
/** * Encode <code>integer</code> as a series of 4 bytes into <code>buf</code> * starting at position 0 within that buffer. * * @param integer * The integer to encode. * @param buf * The buffer to write to. */ public static final void encodeBigEndian(final int integer, final byte[] buf) { encodeBigEndian(integer, buf, 0); }
public static final int setBit(int v, int position, boolean value) { if(value) return v | (1 << position); else return clearBit(v, position); }
/** * Returns v, with the bit at position set to 1 or 0 depending on value. */ public static final byte setBit(byte v, int position, boolean value) { return (byte)setBit((int)v, position, value); }
/** * Bitfield utilities. * Returns true if the bit at position is set in v. */ public static final boolean testBit(byte v, int position) { return testBit((int)v, position); }
/** * Read a 4-byte word from the underlying transport and interpret it as an * integer. * * @return The length prefix of the next SASL message to read. * @throws TTransportException * Thrown if reading from the underlying transport fails. */ protected int readLength() throws TTransportException { byte[] lenBuf = new byte[4]; underlyingTransport.readAll(lenBuf, 0, lenBuf.length); return EncodingUtils.decodeBigEndian(lenBuf); }
/** * Returns v, with the bit at position set to zero. */ public static final byte clearBit(byte v, int position) { return (byte)clearBit((int)v, position); }
public void setMajorIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAJOR_ISSET_ID, value); }
/** Returns true if field requestedInstanceCount is set (has been assigned a value) and false otherwise */ public boolean isSetRequestedInstanceCount() { return EncodingUtils.testBit(__isset_bitfield, __REQUESTEDINSTANCECOUNT_ISSET_ID); }
/** * Read a 4-byte word from the underlying transport and interpret it as an * integer. * * @return The length prefix of the next SASL message to read. * @throws TTransportException * Thrown if reading from the underlying transport fails. */ protected int readLength() throws TTransportException { byte[] lenBuf = new byte[4]; underlyingTransport.readAll(lenBuf, 0, lenBuf.length); return EncodingUtils.decodeBigEndian(lenBuf); }
public static final int setBit(int v, int position, boolean value) { if(value) return v | (1 << position); else return clearBit(v, position); }
public void setRequestedInstanceCountIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTEDINSTANCECOUNT_ISSET_ID, value); }
/** Returns true if field runningInstanceCount is set (has been assigned a value) and false otherwise */ public boolean isSetRunningInstanceCount() { return EncodingUtils.testBit(__isset_bitfield, __RUNNINGINSTANCECOUNT_ISSET_ID); }
/** * Returns v, with the bit at position set to zero. */ public static final byte clearBit(byte v, int position) { return (byte)clearBit((int)v, position); }
public void setRunningInstanceCountIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNNINGINSTANCECOUNT_ISSET_ID, value); }