<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:43 CET 2013 -->
<title>BufferUtils (libgdx API)
</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BufferUtils (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.
</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/BufferUtils.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../index-all.html">Index
</a></li>
<li><a href="../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/utils/BooleanArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../com/badlogic/gdx/utils/CharArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/utils/BufferUtils.html" target="_top">Frames
</a></li>
<li><a href="BufferUtils.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li>Field
|
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li>Field
|
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.utils
</div>
<h2 title="Class BufferUtils" class="title">Class BufferUtils
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.utils.BufferUtils
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class
<span class="strong">BufferUtils
</span>
extends java.lang.Object
</pre>
<div class="block">Class with static helper methods to increase the speed of array/direct buffer and direct buffer/direct buffer transfers
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description
</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#BufferUtils()">BufferUtils
</a></strong>()
</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Method and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#clear(java.nio.ByteBuffer, int)">clear
</a></strong>(java.nio.ByteBuffer
buffer,
int
numBytes)
</code>
<div class="block">Writes the specified number of zeros to the buffer.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(java.nio.Buffer, java.nio.Buffer, int)">copy
</a></strong>(java.nio.Buffer
src,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from the current position of src, copying numElements elements (using the data
type of src, no matter the datatype of dst).
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(byte[], int, java.nio.Buffer, int)">copy
</a></strong>(byte[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(char[], int, java.nio.Buffer, int)">copy
</a></strong>(char[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(double[], int, java.nio.Buffer, int)">copy
</a></strong>(double[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(float[], java.nio.Buffer, int, int)">copy
</a></strong>(float[]
src,
java.nio.Buffer
dst,
int
numFloats,
int
offset)
</code>
<div class="block">Copies numFloats floats from src starting at offset to dst.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(float[], int, java.nio.Buffer, int)">copy
</a></strong>(float[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(int[], int, java.nio.Buffer, int)">copy
</a></strong>(int[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(long[], int, java.nio.Buffer, int)">copy
</a></strong>(long[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#copy(short[], int, java.nio.Buffer, int)">copy
</a></strong>(short[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</code>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#disposeUnsafeByteBuffer(java.nio.ByteBuffer)">disposeUnsafeByteBuffer
</a></strong>(java.nio.ByteBuffer
buffer)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#getAllocatedBytesUnsafe()">getAllocatedBytesUnsafe
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static long
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#getUnsafeBufferAddress(java.nio.Buffer)">getUnsafeBufferAddress
</a></strong>(java.nio.Buffer
buffer)
</code>
<div class="block">Returns the address of the Buffer, it assumes it is an unsafe buffer.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.nio.ByteBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newByteBuffer(int)">newByteBuffer
</a></strong>(int
numBytes)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.nio.CharBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newCharBuffer(int)">newCharBuffer
</a></strong>(int
numChars)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.nio.DoubleBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newDoubleBuffer(int)">newDoubleBuffer
</a></strong>(int
numDoubles)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.nio.FloatBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newFloatBuffer(int)">newFloatBuffer
</a></strong>(int
numFloats)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.nio.IntBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newIntBuffer(int)">newIntBuffer
</a></strong>(int
numInts)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.nio.LongBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newLongBuffer(int)">newLongBuffer
</a></strong>(int
numLongs)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.nio.ShortBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newShortBuffer(int)">newShortBuffer
</a></strong>(int
numShorts)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.nio.ByteBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newUnsafeByteBuffer(java.nio.ByteBuffer)">newUnsafeByteBuffer
</a></strong>(java.nio.ByteBuffer
buffer)
</code>
<div class="block">Registers the given ByteBuffer as an unsafe ByteBuffer.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.nio.ByteBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newUnsafeByteBuffer(int)">newUnsafeByteBuffer
</a></strong>(int
numBytes)
</code>
<div class="block">Allocates a new direct ByteBuffer from native heap memory using the native byte order.
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class
java.lang.Object
</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="BufferUtils()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>BufferUtils
</h4>
<pre>public
BufferUtils()
</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="copy(float[], java.nio.Buffer, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(float[]
src,
java.nio.Buffer
dst,
int
numFloats,
int
offset)
</pre>
<div class="block">Copies numFloats floats from src starting at offset to dst. Dst is assumed to be a direct
<code>Buffer
</code>. The method will
crash if that is not the case. The position and limit of the buffer are ignored, the copy is placed at position 0 in the
buffer. After the copying process the position of the buffer is set to 0 and its limit is set to numFloats * 4 if it is a
ByteBuffer and numFloats if it is a FloatBuffer. In case the Buffer is neither a ByteBuffer nor a FloatBuffer the limit is
not set. This is an expert method, use at your own risk.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array
</dd><dd><code>dst
</code> - the destination buffer, has to be a direct Buffer
</dd><dd><code>numFloats
</code> - the number of floats to copy
</dd><dd><code>offset
</code> - the offset in src to start copying from
</dd></dl>
</li>
</ul>
<a name="copy(byte[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(byte[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(short[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(short[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(char[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(char[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(int[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(int[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(long[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(long[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(float[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(float[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(double[], int, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(double[]
src,
int
srcOffset,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The
<code>Buffer
</code> instance's
<code>Buffer.position()
</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit
will be set to position + numElements.
<b>The Buffer must be a direct Buffer with native byte order. No error checking is
performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source array.
</dd><dd><code>srcOffset
</code> - the offset into the source array.
</dd><dd><code>dst
</code> - the destination Buffer, its position is used as an offset.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="copy(java.nio.Buffer, java.nio.Buffer, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public static
void
copy(java.nio.Buffer
src,
java.nio.Buffer
dst,
int
numElements)
</pre>
<div class="block">Copies the contents of src to dst, starting from the current position of src, copying numElements elements (using the data
type of src, no matter the datatype of dst). The dst
<code>Buffer.position()
</code> is used as the writing offset. The position
of both Buffers will stay the same. The limit of the src Buffer will stay the same. The limit of the dst Buffer will be set
to dst.position() + numElements, where numElements are translated to the number of elements appropriate for the dst Buffer
data type.
<b>The Buffers must be direct Buffers with native byte order. No error checking is performed
</b>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>src
</code> - the source Buffer.
</dd><dd><code>dst
</code> - the destination Buffer.
</dd><dd><code>numElements
</code> - the number of elements to copy.
</dd></dl>
</li>
</ul>
<a name="newFloatBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newFloatBuffer
</h4>
<pre>public static
java.nio.FloatBuffer
newFloatBuffer(int
numFloats)
</pre>
</li>
</ul>
<a name="newDoubleBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newDoubleBuffer
</h4>
<pre>public static
java.nio.DoubleBuffer
newDoubleBuffer(int
numDoubles)
</pre>
</li>
</ul>
<a name="newByteBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newByteBuffer
</h4>
<pre>public static
java.nio.ByteBuffer
newByteBuffer(int
numBytes)
</pre>
</li>
</ul>
<a name="newShortBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newShortBuffer
</h4>
<pre>public static
java.nio.ShortBuffer
newShortBuffer(int
numShorts)
</pre>
</li>
</ul>
<a name="newCharBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newCharBuffer
</h4>
<pre>public static
java.nio.CharBuffer
newCharBuffer(int
numChars)
</pre>
</li>
</ul>
<a name="newIntBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newIntBuffer
</h4>
<pre>public static
java.nio.IntBuffer
newIntBuffer(int
numInts)
</pre>
</li>
</ul>
<a name="newLongBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newLongBuffer
</h4>
<pre>public static
java.nio.LongBuffer
newLongBuffer(int
numLongs)
</pre>
</li>
</ul>
<a name="disposeUnsafeByteBuffer(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>disposeUnsafeByteBuffer
</h4>
<pre>public static
void
disposeUnsafeByteBuffer(java.nio.ByteBuffer
buffer)
</pre>
</li>
</ul>
<a name="newUnsafeByteBuffer(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newUnsafeByteBuffer
</h4>
<pre>public static
java.nio.ByteBuffer
newUnsafeByteBuffer(int
numBytes)
</pre>
<div class="block">Allocates a new direct ByteBuffer from native heap memory using the native byte order. Needs to be disposed with
<a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#freeMemory(java.nio.ByteBuffer)"><code>freeMemory(ByteBuffer)
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>numBytes
</code> -
</dd></dl>
</li>
</ul>
<a name="getUnsafeBufferAddress(java.nio.Buffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUnsafeBufferAddress
</h4>
<pre>public static
long
getUnsafeBufferAddress(java.nio.Buffer
buffer)
</pre>
<div class="block">Returns the address of the Buffer, it assumes it is an unsafe buffer.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>buffer
</code> - The Buffer to ask the address for.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the address of the Buffer.
</dd></dl>
</li>
</ul>
<a name="newUnsafeByteBuffer(java.nio.ByteBuffer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newUnsafeByteBuffer
</h4>
<pre>public static
java.nio.ByteBuffer
newUnsafeByteBuffer(java.nio.ByteBuffer
buffer)
</pre>
<div class="block">Registers the given ByteBuffer as an unsafe ByteBuffer. The ByteBuffer must have been
allocated in native code, pointing to a memory region allocated via malloc. Needs to
be disposed with
<a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#freeMemory(java.nio.ByteBuffer)"><code>freeMemory(ByteBuffer)
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>buffer
</code> - the
<code>ByteBuffer
</code> to register
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the ByteBuffer passed to the method
</dd></dl>
</li>
</ul>
<a name="getAllocatedBytesUnsafe()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAllocatedBytesUnsafe
</h4>
<pre>public static
int
getAllocatedBytesUnsafe()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the number of bytes allocated with
<a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newUnsafeByteBuffer(int)"><code>newUnsafeByteBuffer(int)
</code></a></dd></dl>
</li>
</ul>
<a name="clear(java.nio.ByteBuffer, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>clear
</h4>
<pre>public static
void
clear(java.nio.ByteBuffer
buffer,
int
numBytes)
</pre>
<div class="block">Writes the specified number of zeros to the buffer. This is generally faster than reallocating a new buffer.
</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/BufferUtils.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../index-all.html">Index
</a></li>
<li><a href="../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/utils/BooleanArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../com/badlogic/gdx/utils/CharArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/utils/BufferUtils.html" target="_top">Frames
</a></li>
<li><a href="BufferUtils.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li>Nested
|
</li>
<li>Field
|
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li>Field
|
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright
© 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>