Prepares an int for printing with leading zeros for the given size.
@param i the int to prepare
@param size max value for i
@return printable string for i with leading zeros
19924
private static String getLeadingZeros(int i, int size)
	{
		assert i <= size;
		int w1 = (int) Math.floor(Math.log10(size));
		int w2 = (int) Math.floor(Math.log10(i));
		
		String s = "";

		for (int j = w2; j < w1; j++)
		{
			s += "0";
		}
		return s;
	}
393002
public final void setToSize(int size) {
    
    int newMap[] = new int[size];

    System.arraycopy(m_map, 0, newMap, 0, m_map[m_lengthPos]);

    m_mapSize = size;
    m_map = newMap;
    
  }
643226
protected function prepare(int $size): int
    {
        if ($size <= 0) {
            return 0;
        }

        for ($i = 0; $i < $size; $i++) {
            $res = $this->create();
            $this->chan->push($res);
        }

        return $size;
    }
480593
public static Text createText(int size)
    {
        return factoryGraphic.createText(Constant.FONT_SANS_SERIF, size, TextStyle.NORMAL);
    }
1127177
public final void setToSize(int size) {
    
    Object newMap[] = new Object[size];
    
    System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
    m_mapSize = size;

    m_map = newMap;
    
  }
900275
public static BitWriter writerTo(int[] ints, long size) {
		if (ints == null) throw new IllegalArgumentException("null ints");
		if (size < 0) throw new IllegalArgumentException("negative size");
		long maxSize = ((long) ints.length) << 5;
		if (size > maxSize) throw new IllegalArgumentException("size exceeds maximum permitted by array length");
		return new IntArrayBitWriter(ints);
	}
1243835
public WhiteSpaceInfo getPreserveSpace(int i) throws ArrayIndexOutOfBoundsException
  {

    if (null == m_whitespacePreservingElements)
      throw new ArrayIndexOutOfBoundsException();

    return (WhiteSpaceInfo) m_whitespacePreservingElements.elementAt(i);
  }
86032
public static int getVIntSize(long i) {
        if (i >= -112 && i <= 127) {
            return 1;
        }

        if (i < 0) {
            i ^= -1L; // take one's complement'
        }
        // find the number of bytes with non-leading zeros
        int dataBits = Long.SIZE - Long.numberOfLeadingZeros(i);
        // find the number of data bytes + length byte
        return (dataBits + 7) / 8 + 1;
    }
301691
public String produce(int size) {
        byte bytes[] = new byte[size];
        _random.nextBytes(bytes);
        return Strings.toHexString(bytes);
    }
444564
def parse_size(size):
        
        if size.startswith('x'):
            return None, int(size.replace('x', ''))
        if 'x' in size:
            return int(size.split('x')[0]), int(size.split('x')[1])
        return int(size), None
1331445
private int getPadForLabel(int i) {
        Dictionary dictionary = slider.getLabelTable();
        int pad = 0;

        Object o = dictionary.get(i);
        if (o != null) {
            Component c = (Component) o;
            int centerX = xPositionForValue(i);
            int cHalfWidth = c.getPreferredSize().width / 2;
            if (centerX - cHalfWidth < insetCache.left) {
                pad = Math.max(pad, insetCache.left - (centerX - cHalfWidth));
            }

            if (centerX + cHalfWidth > slider.getWidth() - insetCache.right) {
                pad = Math.max(pad, (centerX + cHalfWidth) - (slider.getWidth() - insetCache.right));
            }
        }
        return pad;
    }
373376
public void set(int i) {
		int offset = i - this.sizeinwords * WORDSIZE;
		if (offset + WORDSIZE < 0) {
			throw new IllegalArgumentException("unsupported write back");
		} else if ((offset + WORDSIZE >= 0) && (offset < 0)) {
			final int before = this.buffer.get(this.buffer.size() - 1);
			this.buffer.set(this.buffer.size() - 1, before
					| (1 << (offset + WORDSIZE)));
			// if(before != buffer.get(buffer.size()-1)) ++ cardinality;
		} else {
			final int numberofemptywords = offset / WORDSIZE;
			offset -= numberofemptywords * WORDSIZE;
			fastadd(1 << offset, this.sizeinwords + numberofemptywords);
			// ++cardinality;
		}

	}
538698
public static int size(String size, int defaultValue) {
        int parseInt = NumUtils.intVal(size, defaultValue);
        return parseInt <= 0 ? defaultValue
                : (parseInt > DEFAULT_MAX_PAGE_SIZE ? DEFAULT_MAX_PAGE_SIZE : parseInt);
    }
1024065
public static void appendSize(StringBuilder buf, long size) {
        if (size >= 104857600) { // >= 100 MiB
            buf.append(size / 1048576).append("MiB(").append(size).append("B)");
        } else if (size >= 102400) { // >= 100 KiB
            buf.append(size / 1024).append("KiB(").append(size).append("B)");
        } else {
            buf.append(size).append('B');
        }
    }
451954
public BatcherBuilder sizeBound(int size) {
        checkState(this.maxSize == UNSET_INT, "Max size already set to %s", this.maxSize);
        checkArgument(size > 0, "Required to have a size bound greater than 0");
        this.maxSize = size;
        return this;
    }
969172
public static void writeUnsignedInt(ObjectOutput out, int i) throws IOException {
      while ((i & ~0x7F) != 0) {
         out.writeByte((byte) ((i & 0x7f) | 0x80));
         i >>>= 7;
      }
      out.writeByte((byte) i);
   }
584721
public static byte[] integer_to_bytes(int i) {
		final byte[] b = new byte[4];
		b[0] = (byte) (i & 0xff);
		i >>= 8;
		b[1] = (byte) (i & 0xff);
		i >>= 8;
		b[2] = (byte) (i & 0xff);
		i >>= 8;
		b[3] = (byte) (i & 0xff);
		return b;
	}