<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=Buffer.copy</id>
	<title>Buffer.copy - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=Buffer.copy"/>
	<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Buffer.copy&amp;action=history"/>
	<updated>2026-11-17T20:56:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Buffer.copy&amp;diff=24244&amp;oldid=prev</id>
		<title>MoKaLux at 03:57, 6 February 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Buffer.copy&amp;diff=24244&amp;oldid=prev"/>
		<updated>2025-02-06T03:57:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:57, 6 February 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;source&amp;#039;&amp;#039;&amp;#039;: (buffer) buffer to take the data from&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;source&amp;#039;&amp;#039;&amp;#039;: (buffer) buffer to take the data from&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;sourceOffset&amp;#039;&amp;#039;&amp;#039;: (number) offset from the beginning of the buffer memory, starting from 0 &amp;#039;&amp;#039;&amp;#039;optional&amp;#039;&amp;#039;&amp;#039; default = 0&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;sourceOffset&amp;#039;&amp;#039;&amp;#039;: (number) offset from the beginning of the buffer memory, starting from 0 &amp;#039;&amp;#039;&amp;#039;optional&amp;#039;&amp;#039;&amp;#039; default = 0&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;count&#039;&#039;&#039;: (number) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Number &lt;/del&gt;of bytes to copy &#039;&#039;&#039;optional&#039;&#039;&#039; if omitted, the whole source data starting from sourceOffset is taken&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;count&#039;&#039;&#039;: (number) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;number &lt;/ins&gt;of bytes to copy &#039;&#039;&#039;optional&#039;&#039;&#039; if omitted, the whole source data starting from sourceOffset is taken&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Example ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Example ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Buffer.copy&amp;diff=24230&amp;oldid=prev</id>
		<title>MoKaLux: Created page with &quot;__NOTOC__ &#039;&#039;&#039;Available since:&#039;&#039;&#039; Gideros 2025.1&lt;br/&gt; &#039;&#039;&#039;Class:&#039;&#039;&#039; buffer_luau&lt;br/&gt;  === Description === Copies &#039;&#039;count&#039;&#039; bytes from &#039;&#039;source&#039;&#039; starting at offset &#039;&#039;sourceO...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Buffer.copy&amp;diff=24230&amp;oldid=prev"/>
		<updated>2025-02-06T00:31:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__ &amp;#039;&amp;#039;&amp;#039;Available since:&amp;#039;&amp;#039;&amp;#039; Gideros 2025.1&amp;lt;br/&amp;gt; &amp;#039;&amp;#039;&amp;#039;Class:&amp;#039;&amp;#039;&amp;#039; &lt;a href=&quot;/index.php/Buffer_luau&quot; title=&quot;Buffer luau&quot;&gt;buffer_luau&lt;/a&gt;&amp;lt;br/&amp;gt;  === Description === Copies &amp;#039;&amp;#039;count&amp;#039;&amp;#039; bytes from &amp;#039;&amp;#039;source&amp;#039;&amp;#039; starting at offset &amp;#039;&amp;#039;sourceO...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Available since:&amp;#039;&amp;#039;&amp;#039; Gideros 2025.1&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Class:&amp;#039;&amp;#039;&amp;#039; [[buffer_luau]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
Copies &amp;#039;&amp;#039;count&amp;#039;&amp;#039; bytes from &amp;#039;&amp;#039;source&amp;#039;&amp;#039; starting at offset &amp;#039;&amp;#039;sourceOffset&amp;#039;&amp;#039; into the &amp;#039;&amp;#039;target&amp;#039;&amp;#039; at &amp;#039;&amp;#039;targetOffset&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
buffer.copy(target,targetOffset,source,sourceOffset,count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s possible for source and target to be the same. Copying an overlapping region inside the same buffer acts as if the source region is copied into a temporary buffer and then that buffer is copied over to the target.&lt;br /&gt;
&lt;br /&gt;
=== Parameters ===&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;target&amp;#039;&amp;#039;&amp;#039;: (buffer) buffer to copy data into&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;targetOffset&amp;#039;&amp;#039;&amp;#039;: (number) offset from the beginning of the buffer memory, starting from 0&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;source&amp;#039;&amp;#039;&amp;#039;: (buffer) buffer to take the data from&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sourceOffset&amp;#039;&amp;#039;&amp;#039;: (number) offset from the beginning of the buffer memory, starting from 0 &amp;#039;&amp;#039;&amp;#039;optional&amp;#039;&amp;#039;&amp;#039; default = 0&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;count&amp;#039;&amp;#039;&amp;#039;: (number) Number of bytes to copy &amp;#039;&amp;#039;&amp;#039;optional&amp;#039;&amp;#039;&amp;#039; if omitted, the whole source data starting from sourceOffset is taken&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local b: buffer = buffer.create(16)&lt;br /&gt;
local count = 7&lt;br /&gt;
local b2: buffer = buffer.create(count)&lt;br /&gt;
local targetOffset, sourceOffset = 0, 2&lt;br /&gt;
buffer.copy(b2, targetOffset, b, sourceOffset, count)&lt;br /&gt;
print(buffer.tostring(b2))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{buffer_luau}}&lt;/div&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
</feed>