equal
deleted
inserted
replaced
187 * {@code BitSet.valueOf(LongBuffer.wrap(longs))}. |
187 * {@code BitSet.valueOf(LongBuffer.wrap(longs))}. |
188 * |
188 * |
189 * @param longs a long array containing a little-endian representation |
189 * @param longs a long array containing a little-endian representation |
190 * of a sequence of bits to be used as the initial bits of the |
190 * of a sequence of bits to be used as the initial bits of the |
191 * new bit set |
191 * new bit set |
|
192 * @return a {@code BitSet} containing all the bits in the long array |
192 * @since 1.7 |
193 * @since 1.7 |
193 */ |
194 */ |
194 public static BitSet valueOf(long[] longs) { |
195 public static BitSet valueOf(long[] longs) { |
195 int n; |
196 int n; |
196 for (n = longs.length; n > 0 && longs[n - 1] == 0; n--) |
197 for (n = longs.length; n > 0 && longs[n - 1] == 0; n--) |
210 * reference to the buffer is retained by the bit set. |
211 * reference to the buffer is retained by the bit set. |
211 * |
212 * |
212 * @param lb a long buffer containing a little-endian representation |
213 * @param lb a long buffer containing a little-endian representation |
213 * of a sequence of bits between its position and limit, to be |
214 * of a sequence of bits between its position and limit, to be |
214 * used as the initial bits of the new bit set |
215 * used as the initial bits of the new bit set |
|
216 * @return a {@code BitSet} containing all the bits in the buffer in the |
|
217 * specified range |
215 * @since 1.7 |
218 * @since 1.7 |
216 */ |
219 */ |
217 public static BitSet valueOf(LongBuffer lb) { |
220 public static BitSet valueOf(LongBuffer lb) { |
218 lb = lb.slice(); |
221 lb = lb.slice(); |
219 int n; |
222 int n; |
235 * {@code BitSet.valueOf(ByteBuffer.wrap(bytes))}. |
238 * {@code BitSet.valueOf(ByteBuffer.wrap(bytes))}. |
236 * |
239 * |
237 * @param bytes a byte array containing a little-endian |
240 * @param bytes a byte array containing a little-endian |
238 * representation of a sequence of bits to be used as the |
241 * representation of a sequence of bits to be used as the |
239 * initial bits of the new bit set |
242 * initial bits of the new bit set |
|
243 * @return a {@code BitSet} containing all the bits in the byte array |
240 * @since 1.7 |
244 * @since 1.7 |
241 */ |
245 */ |
242 public static BitSet valueOf(byte[] bytes) { |
246 public static BitSet valueOf(byte[] bytes) { |
243 return BitSet.valueOf(ByteBuffer.wrap(bytes)); |
247 return BitSet.valueOf(ByteBuffer.wrap(bytes)); |
244 } |
248 } |
255 * reference to the buffer is retained by the bit set. |
259 * reference to the buffer is retained by the bit set. |
256 * |
260 * |
257 * @param bb a byte buffer containing a little-endian representation |
261 * @param bb a byte buffer containing a little-endian representation |
258 * of a sequence of bits between its position and limit, to be |
262 * of a sequence of bits between its position and limit, to be |
259 * used as the initial bits of the new bit set |
263 * used as the initial bits of the new bit set |
|
264 * @return a {@code BitSet} containing all the bits in the buffer in the |
|
265 * specified range |
260 * @since 1.7 |
266 * @since 1.7 |
261 */ |
267 */ |
262 public static BitSet valueOf(ByteBuffer bb) { |
268 public static BitSet valueOf(ByteBuffer bb) { |
263 bb = bb.slice().order(ByteOrder.LITTLE_ENDIAN); |
269 bb = bb.slice().order(ByteOrder.LITTLE_ENDIAN); |
264 int n; |
270 int n; |