Create pointer with oid and size.

@param oid  Object oid.
@param size Object size.
@return Return pointer data.
493061
@NotNull
  public static Map<String, String> createPointer(@NotNull String oid, long size) {
    final Map<String, String> pointer = new TreeMap<>();
    pointer.put(VERSION, VERSION_URL);
    pointer.put(OID, oid);
    pointer.put(SIZE, Long.toString(size));
    return pointer;
  }
540386
public static LongTuple zero(int size)
    {
        if (size >= 0 && size < ZERO_POOL_SIZE)
        {
            return ZEROS[size];
        }
        return createZero(size);
    }
169575
public ByteArray readBytes(int size) throws IOException
   {
      byte[] data = new byte[size];
      m_stream.read(data);
      return new ByteArray(data);
   }
480593
public static Text createText(int size)
    {
        return factoryGraphic.createText(Constant.FONT_SANS_SERIF, size, TextStyle.NORMAL);
    }
828183
public static byte[] checkLength(byte[] data, int size) {
        if (data == null) {
            throw new IllegalArgumentException("Data to check the length of are null.");
        }
        if (data.length < size) {
            throw new IllegalArgumentException("Invalid length: " + data.length);
        }
        return data;
    }
926959
private static int sizeToInt(String size) {
		int position = size.indexOf('p');
		if (position < 0) {
			return Integer.parseInt(size);
		}
		return Integer.parseInt(size.substring(0, position));
	}
852925
public boolean add (int oid)
    {
        // check for existence
        for (int ii = 0; ii < _size; ii++) {
            if (_oids[ii] == oid) {
                return false;
            }
        }

        // make room if necessary
        if (_size+1 >= _oids.length) {
            expand();
        }

        // add the oid
        _oids[_size++] = oid;
        return true;
    }
297604
public StreamCutReferenceRecord findStreamCutReferenceForSize(long size) {
        int beforeIndex = getGreatestLowerBound(this, size, StreamCutReferenceRecord::getRecordingSize);
        if (beforeIndex < 0) {
            return null;
        }

        return retentionRecords.get(beforeIndex);
    }
894608
public byte[] readRawBytes(final int size) throws IOException
    {
        if (size < 0)
        {
            throw ProtobufException.negativeSize();
        }

        if (totalBytesRetired + bufferPos + size > currentLimit)
        {
            // Read to the end of the stream anyway.
            skipRawBytes(currentLimit - totalBytesRetired - bufferPos);
            // Then fail.
            throw ProtobufException.truncatedMessage();
        }

        if (size <= bufferSize - bufferPos)
        {
            // We have all the bytes we need already.
            final byte[] bytes = new byte[size];
            System.arraycopy(buffer, bufferPos, bytes, 0, size);
            bufferPos += size;
            return bytes;
        }
        else if (size < buffer.length)
        {
            // Reading more bytes than are in the buffer, but not an excessive number
            // of bytes. We can safely allocate the resulting array ahead of time.

            // First copy what we have.
            final byte[] bytes = new byte[size];
            int pos = bufferSize - bufferPos;
            System.arraycopy(buffer, bufferPos, bytes, 0, pos);
            bufferPos = bufferSize;

            // We want to use refillBuffer() and then copy from the buffer into our
            // byte array rather than reading directly into our byte array because
            // the input may be unbuffered.
            refillBuffer(true);

            while (size - pos > bufferSize)
            {
                System.arraycopy(buffer, 0, bytes, pos, bufferSize);
                pos += bufferSize;
                bufferPos = bufferSize;
                refillBuffer(true);
            }

            System.arraycopy(buffer, 0, bytes, pos, size - pos);
            bufferPos = size - pos;

            return bytes;
        }
        else
        {
            // The size is very large. For security reasons, we can't allocate the
            // entire byte array yet. The size comes directly from the input, so a
            // maliciously-crafted message could provide a bogus very large size in
            // order to trick the app into allocating a lot of memory. We avoid this
            // by allocating and reading only a small chunk at a time, so that the
            // malicious message must actually *be* extremely large to cause
            // problems. Meanwhile, we limit the allowed size of a message elsewhere.

            // Remember the buffer markers since we'll have to copy the bytes out of
            // it later.
            final int originalBufferPos = bufferPos;
            final int originalBufferSize = bufferSize;

            // Mark the current buffer consumed.
            totalBytesRetired += bufferSize;
            bufferPos = 0;
            bufferSize = 0;

            // Read all the rest of the bytes we need.
            int sizeLeft = size - (originalBufferSize - originalBufferPos);
            final List<byte[]> chunks = new ArrayList<byte[]>();

            while (sizeLeft > 0)
            {
                final byte[] chunk = new byte[Math.min(sizeLeft, buffer.length)];
                int pos = 0;
                while (pos < chunk.length)
                {
                    final int n = (input == null) ? -1 :
                            input.read(chunk, pos, chunk.length - pos);
                    if (n == -1)
                    {
                        throw ProtobufException.truncatedMessage();
                    }
                    totalBytesRetired += n;
                    pos += n;
                }
                sizeLeft -= chunk.length;
                chunks.add(chunk);
            }

            // OK, got everything. Now concatenate it all into one buffer.
            final byte[] bytes = new byte[size];

            // Start by copying the leftover bytes from this.buffer.
            int pos = originalBufferSize - originalBufferPos;
            System.arraycopy(buffer, originalBufferPos, bytes, 0, pos);

            // And now all the chunks.
            for (final byte[] chunk : chunks)
            {
                System.arraycopy(chunk, 0, bytes, pos, chunk.length);
                pos += chunk.length;
            }

            // Done.
            return bytes;
        }
    }
1312366
public static <K, V> HashMap<K, V> newHashMap(int size, boolean isOrder) {
		int initialCapacity = (int) (size / DEFAULT_LOAD_FACTOR);
		return isOrder ? new LinkedHashMap<K, V>(initialCapacity) : new HashMap<K, V>(initialCapacity);
	}
1316119
public static String rand(int size) {
        StringBuilder num = new StringBuilder();
        for (int i = 0; i < size; i++) {
            double a = Math.random() * 9;
            a = Math.ceil(a);
            int randomNum = new Double(a).intValue();
            num.append(randomNum);
        }
        return num.toString();
    }
1002078
protected byte[] ensureBufferSize(final int size, final Context context){
        if ((context.buffer == null) || (context.buffer.length < context.pos + size)){
            return resizeBuffer(context);
        }
        return context.buffer;
    }
1349316
public static StringBuilder size(long size) {
        final StringBuilder buf = new StringBuilder(16);
        appendSize(buf, size);
        return buf;
    }
301691
public String produce(int size) {
        byte bytes[] = new byte[size];
        _random.nextBytes(bytes);
        return Strings.toHexString(bytes);
    }
794977
@SuppressWarnings("unchecked") // Safe as long as the javadocs are followed
  static <K, V> ImmutableMapEntry<K, V>[] createEntryArray(int size) {
    return new ImmutableMapEntry[size];
  }
754079
function SigCache(size) {
  if (!(this instanceof SigCache))
    return new SigCache(size);

  if (size == null)
    size = 10000;

  assert(util.isU32(size));

  this.size = size;
  this.keys = [];
  this.valid = new Map();
}
678946
def getsizeof(o, ids=None):
    '''
    
    '''
    ids = ids or set()
    if id(o) in ids:
        return 0

    nbytes = sys.getsizeof(o)
    ids.add(id(o))

    if isinstance(o, Mapping):
        return nbytes + sum(getsizeof(k, ids) + getsizeof(v, ids)
                            for k, v in o.items())
    elif isinstance(o, Container):
        return nbytes + sum(getsizeof(x, ids) for x in o)

    return nbytes