Here you can find the source of copyBits(BitSet source, BitSet dest, int fromIndex)
Parameter | Description |
---|---|
source | a parameter |
dest | a parameter |
fromIndex | a parameter |
public static BitSet copyBits(BitSet source, BitSet dest, int fromIndex)
//package com.java2s; /* Image to ZX Spec/*from w ww . ja va 2s . c om*/ * Copyright (C) 2014 Silent Software (Benjamin Brown) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import java.util.BitSet; public class Main { /** * Copy bits completely from a source BitSet to * a destination BitSet starting at the destination * index * * @param source * @param dest * @param fromIndex * @return */ public static BitSet copyBits(BitSet source, BitSet dest, int fromIndex) { for (int i = 0; i < source.length(); i++) { if (source.get(i)) { dest.set(fromIndex + i); } } return dest; } }