protected function readChunk($handle, $chunkSize)
    {
        $byteCount = 0;
        $giantChunk = '';
        while (!feof($handle)) {
            /*
             * fread will never return more than 8192 bytes if the stream is read
             * buffered and it does not represent a plain file
             */
            $chunk = fread($handle, 8192);
            $byteCount += strlen($chunk);
            $giantChunk .= $chunk;
            if ($byteCount >= $chunkSize) {
                return $giantChunk;
            }
        }

        return $giantChunk;
    }
protected function readChunk($handle, $chunkSize)
    {
        $byteCount = 0;
        $giantChunk = '';
        while (!feof($handle)) {
            /*
             * fread will never return more than 8192 bytes if the stream is read
             * buffered and it does not represent a plain file
             */
            $chunk = fread($handle, 8192);
            $byteCount += strlen($chunk);
            $giantChunk .= $chunk;
            if ($byteCount >= $chunkSize) {
                return $giantChunk;
            }
        }

        return $giantChunk;
    }
protected function readChunk ( $ handle , $ chunkSize ) { $ byteCount = 0 ; $ giantChunk = '' ; while ( ! feof ( $ handle ) ) { /*
             * fread will never return more than 8192 bytes if the stream is read
             * buffered and it does not represent a plain file
             */ $ chunk = fread ( $ handle , 8192 ) ; $ byteCount += strlen ( $ chunk ) ; $ giantChunk .= $ chunk ; if ( $ byteCount >= $ chunkSize ) { return $ giantChunk ; } } return $ giantChunk ; }
Get a chunk of data from a file resource

@param resource $handle
@param integer $chunkSize

@return string
Get a chunk of data from a file resource