java.util.BitSet.arrayForBits()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中java.util.BitSet.arrayForBits()方法的一些代码示例,展示了BitSet.arrayForBits()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.arrayForBits()方法的具体详情如下:
包路径:java.util.BitSet
类名称:BitSet
方法名:arrayForBits

BitSet.arrayForBits介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: com.jtransc/jtransc-rt

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
  3. * a multiple of 64.
  4. *
  5. * @throws NegativeArraySizeException if {@code bitCount < 0}.
  6. */
  7. public BitSet(int bitCount) {
  8. if (bitCount < 0) {
  9. throw new NegativeArraySizeException(Integer.toString(bitCount));
  10. }
  11. this.bits = arrayForBits(bitCount);
  12. this.longCount = 0;
  13. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: com.jtransc/jtransc-rt

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
  3. * sequence of bits. This method does not alter the {@code ByteBuffer}.
  4. * @since 1.7
  5. */
  6. public static BitSet valueOf(ByteBuffer byteBuffer) {
  7. byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
  8. long[] longs = arrayForBits(byteBuffer.remaining() * 8);
  9. int i = 0;
  10. while (byteBuffer.remaining() >= SizeOf.LONG) {
  11. longs[i++] = byteBuffer.getLong();
  12. }
  13. for (int j = 0; byteBuffer.hasRemaining(); ++j) {
  14. longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
  15. }
  16. return BitSet.valueOf(longs);
  17. }

相关文章