Java BitSet readByte(BitSet bits, int startByte)

Here you can find the source of readByte(BitSet bits, int startByte)

Description

read Byte

License

Apache License

Declaration

private static byte readByte(BitSet bits, int startByte) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.BitSet;

public class Main {
    private static byte readByte(BitSet bits, int startByte) {
        byte res = 0;
        for (int k = 0; k < 8; k++) {
            if (bits.get(startByte * 8 + k)) {
                res = (byte) (res | (1 << (7 - k)));
            }/*from   ww  w . java 2 s  .c o  m*/
        }
        return res;
    }
}

Related

  1. padToByteBoundary(BitSet actualParameter, int sizeInBits, int byteBoundLength, boolean preserveFirstAsSign)
  2. parseBitSet(byte[] sfData, int offset, int length)
  3. pickRandomSetIndexFromBitSet(BitSet bitset)
  4. printBitSet(BitSet bs)
  5. printBitSet(BitSet iBits, int length)
  6. reverse(final BitSet bitset, final int sizeInBits)
  7. reverseBitSet(BitSet bs)
  8. setBitIterator(final BitSet b)
  9. setBits(BitSet bitSet, Iterable indexes)