Read chunk size from the database.

@return  Chunk size
323973
private int readChunkSize() {
        // read chunk size from database
        int chunkSize = -1;
        Connection conn = null;
        try {
            Class.forName("org.sqlite.JDBC");
            conn = DriverManager.getConnection("jdbc:sqlite:" + databasePath);
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery("SELECT value FROM info where name = 'chunkSize';");
            while (rs.next()) {
                // the first is read
                chunkSize = Integer.parseInt(rs.getString("value"));
                break;
            }
            conn.close();
        } catch (SQLException e) {
            logger.error(e.getClass().getName() + ": " + e.getMessage());
            cleanConnectionClose(conn, null);
        } catch (ClassNotFoundException e) {
            logger.error(e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
        }
        return chunkSize;
    }
253318
public int size() {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "size");

    /* Because the table could be 'resized' (and therefore replaced) during   */
    /* the method we get a local ref to the current one & use it throughout.  */
    Entry[] safeTable = table;

    long count = 0;
    Entry current;

    /* Go through the linked lists in the table, counting non-null entries    */
    for (int i = 0; i < safeTable.length; i++) {
      current = safeTable[i];
      while (current != null) {
        count++;
        current = current.next;
      }
    }

    if (count > Integer.MAX_VALUE) {
      count = Integer.MAX_VALUE;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "size",  (int)count);
    return (int)count;
  }
571883
@Override
    public int size() {
        Node h = putStack.get();
        int putStackSize = h == null ? 0 : h.size;
        return putStackSize + takeStackSize.get();
    }
739057
public int getSize()
  {
    int size = length();
    
    if (_blobs == null) {
      return size;
    }
    
    for (BlobOutputStream blob : _blobs) {
      if (blob != null) {
        size += blob.getSize();
      }
    }
    
    return size;
  }
777198
public function getSize()
    {
        $app = Base::instance();
        $key = 'CACHE.db_size';
        if ($app->devoid($key)) {
            $sql = 'SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024 ), 2)) AS mb_size'.
                ' FROM information_schema.TABLES WHERE TABLE_SCHEMA = ?';
            $query = $this->getConnection()->pdo()->prepare($sql);
            $query->execute([$this->getConfig('name')]);
            $result = $query->fetch(PDO::FETCH_ASSOC);

            $app->set($key, $result ? $result['mb_size'] : 0, 60);
        }

        return $app->get($key);
    }
6190
public function getSize()
    {
        $size = $this->stream->getSize();
        if ($size === null) {
            // this shouldn't happen on a seekable stream I don't think...
            $pos = $this->stream->tell();
            $this->stream->seek(0, SEEK_END);
            $size = $this->stream->tell();
            $this->stream->seek($pos);
        }
        if ($this->limit === -1) {
            return $size - $this->offset;
        } else {
            return min([$this->limit, $size - $this->offset]);
        }
    }
767089
@Override
	public int size() {
		Long longSize = 0L;
		try {
			longSize = new Long(redisManager.dbSize(keySerializer.serialize(this.keyPrefix + "*")));
		} catch (SerializationException e) {
			logger.error("get keys error", e);
		}
		return longSize.intValue();
	}
829627
protected function detectChunkSizeBytes()
    {
        // Max and default chunk size of 100MB
        $chunkSizeBytes = 100 * 1024 * 1024;
        $memoryLimit = $this->getIniBytes('memory_limit');
        if ($memoryLimit > 0) {
            $availableMemory = $memoryLimit - $this->getMemoryUsedBytes();
            /*
             * We need some breathing room, so we only take 1/4th of the available memory for use in chunking (the divide by 4 does this).
             * The chunk size must be a multiple of 256KB(262144).
             * An example of why we need the breathing room is detecting the mime type for a file that is just small enough to fit into one chunk.
             * In this scenario, we send the entire file off as a string to have the mime type detected. Unfortunately, this leads to the entire
             * file being loaded into memory again, separately from the copy we're holding.
             */
            $chunkSizeBytes = max(262144, min($chunkSizeBytes, floor($availableMemory / 4 / 262144) * 262144));
        }

        return (int)$chunkSizeBytes;
    }
196310
public int read() throws IOException {
    if (chunk == null || pos + 1 == chunk.length) {
      if (!fetchChunk()) {
        return -1;
      }
    }
    return chunk[pos++] & 0xff;
  }
1362066
public final int size()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "size");
    int result = (m_tail >= m_head) ? (m_tail - m_head) : (m_array.length - m_head + m_tail);
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "size", new Integer(result));
    return result;
  }
263265
private function readChunked(): string
    {
        $readLength = 0;
        $chunksize  = null;
        $extension  = null;
        $body       = '';
        sscanf($this->socket->readLine(), '%x%s', $chunksize, $extension);
        while (0 < $chunksize) {
            $data        = $this->socket->read($chunksize + 4);
            $body       .= rtrim($data);
            $readLength += $chunksize;
            sscanf($this->socket->readLine(), '%x', $chunksize);
        }

        $this->headers->put('Content-Length', $readLength);
        $this->headers->remove('Transfer-Encoding');
        return $body;
    }
1363709
private function getSizeFromMetadata()
    {
        foreach ($this->stream->getMetadata('wrapper_data') as $value) {
            if (substr($value, 0, 15) == "Content-Length:") {
                return (int) substr($value, 16);
            }
        }
        return 0;
    }
585245
private long getSize() {
		long numSegments = 0;
		numSegments += this.availableMemory.size();
		numSegments += this.buckets.length;
		for(InMemoryPartition<T> p : this.partitions) {
			numSegments += p.getBlockCount();
			numSegments += p.numOverflowSegments;
		}
		numSegments += this.compactionMemory.getBlockCount();
		return numSegments*this.segmentSize;
	}
863152
public long size()
    {
    	if(size==null)
    	{
	    	ODatabaseDocument db = OrientDbWebSession.get().getDatabase();
	    	OSQLSynchQuery<ODocument> query = new OSQLSynchQuery<ODocument>(queryManager.getCountSql());
	    	List<ODocument> ret = db.query(enhanceContextByVariables(query), prepareParams());
	    	if(ret!=null && ret.size()>0)
	    	{
	    		Number sizeNumber = ret.get(0).field("count");
	    		size = sizeNumber!=null?sizeNumber.longValue():0;
	    	}
	    	else
	    	{
	    		size = 0L;
	    	}
    	}
    	return size;
    }
246400
@Nonnegative
  public long getSize ()
  {
    if (m_nSize >= 0)
      return m_nSize;
    if (m_aCachedContent != null)
      return m_aCachedContent.length;
    if (m_aDFOS.isInMemory ())
      return m_aDFOS.getDataLength ();
    return m_aDFOS.getFile ().length ();
  }
256067
public int size() {
        int read = readLocation;
        int write = writeLocation;

        if (write < read)
            write += capacity;

        return write - read;

    }
403767
public function getSize()
    {
        if (! $this->size) {
            $this->size = strlen($this->getContents());
        }
        return $this->size;
    }