{{newin|[[11.0]]|110|type=function}}
Creates a new Data object containing arbitrary bytes.

[[Data:getPointer]] along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
 {{newobjectnotice}}
== Function ==
Creates a new ByteData by copying the contents of the specified string.
=== Synopsis ===
<source lang="lua">
bytedata = love.data.newByteData( datastring )
</source>
=== Arguments ===
{{param|string|datastring|The byte string to copy.}}
=== Returns ===
{{param|ByteData|bytedata|The new Data object.}}

== Function ==
Creates a new ByteData by copying from an existing Data object.
=== Synopsis ===
<source lang="lua">
bytedata = love.data.newByteData( data, offset, size )
</source>
=== Arguments ===
{{param|Data|Data|The existing Data object to copy.}}
{{param|number|offset (0)|The offset of the subsection to copy, in bytes.}}
{{param|number|size (data:getSize())|The size in bytes of the new Data object.}}
=== Returns ===
{{param|ByteData|bytedata|The new Data object.}}

== Function ==
Creates a new empty ByteData with the specific size.
=== Synopsis ===
<source lang="lua">
bytedata = love.data.newByteData( size )
</source>
=== Arguments ===
{{param|number|size|The size in bytes of the new Data object.}}
=== Returns ===
{{param|ByteData|bytedata|The new Data object.}}

== See Also ==
* [[parent::love.data]]
* [[Constructs::ByteData]]
[[Category:Functions]]
{{#set:Description=Creates a new Data object containing arbitrary bytes.}}
== Other Languages ==
{{i18n|love.data.newByteData}}