Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1107 | chris | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 | <!-- NewPage --> |
||
| 3 | <html lang="en"> |
||
| 4 | <head> |
||
| 5 | <!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:43 CET 2013 --> |
||
| 6 | <title>BufferUtils (libgdx API)</title> |
||
| 7 | <meta name="date" content="2013-11-03"> |
||
| 8 | <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
||
| 9 | </head> |
||
| 10 | <body> |
||
| 11 | <script type="text/javascript"><!-- |
||
| 12 | if (location.href.indexOf('is-external=true') == -1) { |
||
| 13 | parent.document.title="BufferUtils (libgdx API)"; |
||
| 14 | } |
||
| 15 | //--> |
||
| 16 | </script> |
||
| 17 | <noscript> |
||
| 18 | <div>JavaScript is disabled on your browser.</div> |
||
| 19 | </noscript> |
||
| 20 | <!-- ========= START OF TOP NAVBAR ======= --> |
||
| 21 | <div class="topNav"><a name="navbar_top"> |
||
| 22 | <!-- --> |
||
| 23 | </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
||
| 24 | <!-- --> |
||
| 25 | </a> |
||
| 26 | <ul class="navList" title="Navigation"> |
||
| 27 | <li><a href="../../../../overview-summary.html">Overview</a></li> |
||
| 28 | <li><a href="package-summary.html">Package</a></li> |
||
| 29 | <li class="navBarCell1Rev">Class</li> |
||
| 30 | <li><a href="class-use/BufferUtils.html">Use</a></li> |
||
| 31 | <li><a href="package-tree.html">Tree</a></li> |
||
| 32 | <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
||
| 33 | <li><a href="../../../../index-all.html">Index</a></li> |
||
| 34 | <li><a href="../../../../help-doc.html">Help</a></li> |
||
| 35 | </ul> |
||
| 36 | <div class="aboutLanguage"><em> |
||
| 37 | libgdx API |
||
| 38 | <style> |
||
| 39 | body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt } |
||
| 40 | pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif } |
||
| 41 | h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold } |
||
| 42 | .TableHeadingColor { background:#EEEEFF; } |
||
| 43 | a { text-decoration:none } |
||
| 44 | a:hover { text-decoration:underline } |
||
| 45 | a:link, a:visited { color:blue } |
||
| 46 | table { border:0px } |
||
| 47 | .TableRowColor td:first-child { border-left:1px solid black } |
||
| 48 | .TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black } |
||
| 49 | hr { border:0px; border-bottom:1px solid #333366; } |
||
| 50 | </style> |
||
| 51 | </em></div> |
||
| 52 | </div> |
||
| 53 | <div class="subNav"> |
||
| 54 | <ul class="navList"> |
||
| 55 | <li><a href="../../../../com/badlogic/gdx/utils/BooleanArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Prev Class</span></a></li> |
||
| 56 | <li><a href="../../../../com/badlogic/gdx/utils/CharArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Next Class</span></a></li> |
||
| 57 | </ul> |
||
| 58 | <ul class="navList"> |
||
| 59 | <li><a href="../../../../index.html?com/badlogic/gdx/utils/BufferUtils.html" target="_top">Frames</a></li> |
||
| 60 | <li><a href="BufferUtils.html" target="_top">No Frames</a></li> |
||
| 61 | </ul> |
||
| 62 | <ul class="navList" id="allclasses_navbar_top"> |
||
| 63 | <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
||
| 64 | </ul> |
||
| 65 | <div> |
||
| 66 | <script type="text/javascript"><!-- |
||
| 67 | allClassesLink = document.getElementById("allclasses_navbar_top"); |
||
| 68 | if(window==top) { |
||
| 69 | allClassesLink.style.display = "block"; |
||
| 70 | } |
||
| 71 | else { |
||
| 72 | allClassesLink.style.display = "none"; |
||
| 73 | } |
||
| 74 | //--> |
||
| 75 | </script> |
||
| 76 | </div> |
||
| 77 | <div> |
||
| 78 | <ul class="subNavList"> |
||
| 79 | <li>Summary: </li> |
||
| 80 | <li>Nested | </li> |
||
| 81 | <li>Field | </li> |
||
| 82 | <li><a href="#constructor_summary">Constr</a> | </li> |
||
| 83 | <li><a href="#method_summary">Method</a></li> |
||
| 84 | </ul> |
||
| 85 | <ul class="subNavList"> |
||
| 86 | <li>Detail: </li> |
||
| 87 | <li>Field | </li> |
||
| 88 | <li><a href="#constructor_detail">Constr</a> | </li> |
||
| 89 | <li><a href="#method_detail">Method</a></li> |
||
| 90 | </ul> |
||
| 91 | </div> |
||
| 92 | <a name="skip-navbar_top"> |
||
| 93 | <!-- --> |
||
| 94 | </a></div> |
||
| 95 | <!-- ========= END OF TOP NAVBAR ========= --> |
||
| 96 | <!-- ======== START OF CLASS DATA ======== --> |
||
| 97 | <div class="header"> |
||
| 98 | <div class="subTitle">com.badlogic.gdx.utils</div> |
||
| 99 | <h2 title="Class BufferUtils" class="title">Class BufferUtils</h2> |
||
| 100 | </div> |
||
| 101 | <div class="contentContainer"> |
||
| 102 | <ul class="inheritance"> |
||
| 103 | <li>java.lang.Object</li> |
||
| 104 | <li> |
||
| 105 | <ul class="inheritance"> |
||
| 106 | <li>com.badlogic.gdx.utils.BufferUtils</li> |
||
| 107 | </ul> |
||
| 108 | </li> |
||
| 109 | </ul> |
||
| 110 | <div class="description"> |
||
| 111 | <ul class="blockList"> |
||
| 112 | <li class="blockList"> |
||
| 113 | <hr> |
||
| 114 | <br> |
||
| 115 | <pre>public class <span class="strong">BufferUtils</span> |
||
| 116 | extends java.lang.Object</pre> |
||
| 117 | <div class="block">Class with static helper methods to increase the speed of array/direct buffer and direct buffer/direct buffer transfers</div> |
||
| 118 | <dl><dt><span class="strong">Author:</span></dt> |
||
| 119 | <dd>mzechner</dd></dl> |
||
| 120 | </li> |
||
| 121 | </ul> |
||
| 122 | </div> |
||
| 123 | <div class="summary"> |
||
| 124 | <ul class="blockList"> |
||
| 125 | <li class="blockList"> |
||
| 126 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
||
| 127 | <ul class="blockList"> |
||
| 128 | <li class="blockList"><a name="constructor_summary"> |
||
| 129 | <!-- --> |
||
| 130 | </a> |
||
| 131 | <h3>Constructor Summary</h3> |
||
| 132 | <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
||
| 133 | <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
||
| 134 | <tr> |
||
| 135 | <th class="colOne" scope="col">Constructor and Description</th> |
||
| 136 | </tr> |
||
| 137 | <tr class="altColor"> |
||
| 138 | <td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#BufferUtils()">BufferUtils</a></strong>()</code> </td> |
||
| 139 | </tr> |
||
| 140 | </table> |
||
| 141 | </li> |
||
| 142 | </ul> |
||
| 143 | <!-- ========== METHOD SUMMARY =========== --> |
||
| 144 | <ul class="blockList"> |
||
| 145 | <li class="blockList"><a name="method_summary"> |
||
| 146 | <!-- --> |
||
| 147 | </a> |
||
| 148 | <h3>Method Summary</h3> |
||
| 149 | <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
||
| 150 | <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
||
| 151 | <tr> |
||
| 152 | <th class="colFirst" scope="col">Modifier and Type</th> |
||
| 153 | <th class="colLast" scope="col">Method and Description</th> |
||
| 154 | </tr> |
||
| 155 | <tr class="altColor"> |
||
| 156 | <td class="colFirst"><code>static void</code></td> |
||
| 157 | <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, |
||
| 158 | int numBytes)</code> |
||
| 159 | <div class="block">Writes the specified number of zeros to the buffer.</div> |
||
| 160 | </td> |
||
| 161 | </tr> |
||
| 162 | <tr class="rowColor"> |
||
| 163 | <td class="colFirst"><code>static void</code></td> |
||
| 164 | <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, |
||
| 165 | java.nio.Buffer dst, |
||
| 166 | int numElements)</code> |
||
| 167 | <div class="block">Copies the contents of src to dst, starting from the current position of src, copying numElements elements (using the data |
||
| 168 | type of src, no matter the datatype of dst).</div> |
||
| 169 | </td> |
||
| 170 | </tr> |
||
| 171 | <tr class="altColor"> |
||
| 172 | <td class="colFirst"><code>static void</code></td> |
||
| 173 | <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, |
||
| 174 | int srcOffset, |
||
| 175 | java.nio.Buffer dst, |
||
| 176 | int numElements)</code> |
||
| 177 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 178 | </td> |
||
| 179 | </tr> |
||
| 180 | <tr class="rowColor"> |
||
| 181 | <td class="colFirst"><code>static void</code></td> |
||
| 182 | <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, |
||
| 183 | int srcOffset, |
||
| 184 | java.nio.Buffer dst, |
||
| 185 | int numElements)</code> |
||
| 186 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 187 | </td> |
||
| 188 | </tr> |
||
| 189 | <tr class="altColor"> |
||
| 190 | <td class="colFirst"><code>static void</code></td> |
||
| 191 | <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, |
||
| 192 | int srcOffset, |
||
| 193 | java.nio.Buffer dst, |
||
| 194 | int numElements)</code> |
||
| 195 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 196 | </td> |
||
| 197 | </tr> |
||
| 198 | <tr class="rowColor"> |
||
| 199 | <td class="colFirst"><code>static void</code></td> |
||
| 200 | <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, |
||
| 201 | java.nio.Buffer dst, |
||
| 202 | int numFloats, |
||
| 203 | int offset)</code> |
||
| 204 | <div class="block">Copies numFloats floats from src starting at offset to dst.</div> |
||
| 205 | </td> |
||
| 206 | </tr> |
||
| 207 | <tr class="altColor"> |
||
| 208 | <td class="colFirst"><code>static void</code></td> |
||
| 209 | <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, |
||
| 210 | int srcOffset, |
||
| 211 | java.nio.Buffer dst, |
||
| 212 | int numElements)</code> |
||
| 213 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 214 | </td> |
||
| 215 | </tr> |
||
| 216 | <tr class="rowColor"> |
||
| 217 | <td class="colFirst"><code>static void</code></td> |
||
| 218 | <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, |
||
| 219 | int srcOffset, |
||
| 220 | java.nio.Buffer dst, |
||
| 221 | int numElements)</code> |
||
| 222 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 223 | </td> |
||
| 224 | </tr> |
||
| 225 | <tr class="altColor"> |
||
| 226 | <td class="colFirst"><code>static void</code></td> |
||
| 227 | <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, |
||
| 228 | int srcOffset, |
||
| 229 | java.nio.Buffer dst, |
||
| 230 | int numElements)</code> |
||
| 231 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 232 | </td> |
||
| 233 | </tr> |
||
| 234 | <tr class="rowColor"> |
||
| 235 | <td class="colFirst"><code>static void</code></td> |
||
| 236 | <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, |
||
| 237 | int srcOffset, |
||
| 238 | java.nio.Buffer dst, |
||
| 239 | int numElements)</code> |
||
| 240 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements.</div> |
||
| 241 | </td> |
||
| 242 | </tr> |
||
| 243 | <tr class="altColor"> |
||
| 244 | <td class="colFirst"><code>static void</code></td> |
||
| 245 | <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> |
||
| 246 | </tr> |
||
| 247 | <tr class="rowColor"> |
||
| 248 | <td class="colFirst"><code>static int</code></td> |
||
| 249 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#getAllocatedBytesUnsafe()">getAllocatedBytesUnsafe</a></strong>()</code> </td> |
||
| 250 | </tr> |
||
| 251 | <tr class="altColor"> |
||
| 252 | <td class="colFirst"><code>static long</code></td> |
||
| 253 | <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> |
||
| 254 | <div class="block">Returns the address of the Buffer, it assumes it is an unsafe buffer.</div> |
||
| 255 | </td> |
||
| 256 | </tr> |
||
| 257 | <tr class="rowColor"> |
||
| 258 | <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
||
| 259 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newByteBuffer(int)">newByteBuffer</a></strong>(int numBytes)</code> </td> |
||
| 260 | </tr> |
||
| 261 | <tr class="altColor"> |
||
| 262 | <td class="colFirst"><code>static java.nio.CharBuffer</code></td> |
||
| 263 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newCharBuffer(int)">newCharBuffer</a></strong>(int numChars)</code> </td> |
||
| 264 | </tr> |
||
| 265 | <tr class="rowColor"> |
||
| 266 | <td class="colFirst"><code>static java.nio.DoubleBuffer</code></td> |
||
| 267 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newDoubleBuffer(int)">newDoubleBuffer</a></strong>(int numDoubles)</code> </td> |
||
| 268 | </tr> |
||
| 269 | <tr class="altColor"> |
||
| 270 | <td class="colFirst"><code>static java.nio.FloatBuffer</code></td> |
||
| 271 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newFloatBuffer(int)">newFloatBuffer</a></strong>(int numFloats)</code> </td> |
||
| 272 | </tr> |
||
| 273 | <tr class="rowColor"> |
||
| 274 | <td class="colFirst"><code>static java.nio.IntBuffer</code></td> |
||
| 275 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newIntBuffer(int)">newIntBuffer</a></strong>(int numInts)</code> </td> |
||
| 276 | </tr> |
||
| 277 | <tr class="altColor"> |
||
| 278 | <td class="colFirst"><code>static java.nio.LongBuffer</code></td> |
||
| 279 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newLongBuffer(int)">newLongBuffer</a></strong>(int numLongs)</code> </td> |
||
| 280 | </tr> |
||
| 281 | <tr class="rowColor"> |
||
| 282 | <td class="colFirst"><code>static java.nio.ShortBuffer</code></td> |
||
| 283 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newShortBuffer(int)">newShortBuffer</a></strong>(int numShorts)</code> </td> |
||
| 284 | </tr> |
||
| 285 | <tr class="altColor"> |
||
| 286 | <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
||
| 287 | <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> |
||
| 288 | <div class="block">Registers the given ByteBuffer as an unsafe ByteBuffer.</div> |
||
| 289 | </td> |
||
| 290 | </tr> |
||
| 291 | <tr class="rowColor"> |
||
| 292 | <td class="colFirst"><code>static java.nio.ByteBuffer</code></td> |
||
| 293 | <td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#newUnsafeByteBuffer(int)">newUnsafeByteBuffer</a></strong>(int numBytes)</code> |
||
| 294 | <div class="block">Allocates a new direct ByteBuffer from native heap memory using the native byte order.</div> |
||
| 295 | </td> |
||
| 296 | </tr> |
||
| 297 | </table> |
||
| 298 | <ul class="blockList"> |
||
| 299 | <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
||
| 300 | <!-- --> |
||
| 301 | </a> |
||
| 302 | <h3>Methods inherited from class java.lang.Object</h3> |
||
| 303 | <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
||
| 304 | </ul> |
||
| 305 | </li> |
||
| 306 | </ul> |
||
| 307 | </li> |
||
| 308 | </ul> |
||
| 309 | </div> |
||
| 310 | <div class="details"> |
||
| 311 | <ul class="blockList"> |
||
| 312 | <li class="blockList"> |
||
| 313 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
||
| 314 | <ul class="blockList"> |
||
| 315 | <li class="blockList"><a name="constructor_detail"> |
||
| 316 | <!-- --> |
||
| 317 | </a> |
||
| 318 | <h3>Constructor Detail</h3> |
||
| 319 | <a name="BufferUtils()"> |
||
| 320 | <!-- --> |
||
| 321 | </a> |
||
| 322 | <ul class="blockListLast"> |
||
| 323 | <li class="blockList"> |
||
| 324 | <h4>BufferUtils</h4> |
||
| 325 | <pre>public BufferUtils()</pre> |
||
| 326 | </li> |
||
| 327 | </ul> |
||
| 328 | </li> |
||
| 329 | </ul> |
||
| 330 | <!-- ============ METHOD DETAIL ========== --> |
||
| 331 | <ul class="blockList"> |
||
| 332 | <li class="blockList"><a name="method_detail"> |
||
| 333 | <!-- --> |
||
| 334 | </a> |
||
| 335 | <h3>Method Detail</h3> |
||
| 336 | <a name="copy(float[], java.nio.Buffer, int, int)"> |
||
| 337 | <!-- --> |
||
| 338 | </a> |
||
| 339 | <ul class="blockList"> |
||
| 340 | <li class="blockList"> |
||
| 341 | <h4>copy</h4> |
||
| 342 | <pre>public static void copy(float[] src, |
||
| 343 | java.nio.Buffer dst, |
||
| 344 | int numFloats, |
||
| 345 | int offset)</pre> |
||
| 346 | <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 |
||
| 347 | 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 |
||
| 348 | 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 |
||
| 349 | ByteBuffer and numFloats if it is a FloatBuffer. In case the Buffer is neither a ByteBuffer nor a FloatBuffer the limit is |
||
| 350 | not set. This is an expert method, use at your own risk.</div> |
||
| 351 | <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> |
||
| 352 | </li> |
||
| 353 | </ul> |
||
| 354 | <a name="copy(byte[], int, java.nio.Buffer, int)"> |
||
| 355 | <!-- --> |
||
| 356 | </a> |
||
| 357 | <ul class="blockList"> |
||
| 358 | <li class="blockList"> |
||
| 359 | <h4>copy</h4> |
||
| 360 | <pre>public static void copy(byte[] src, |
||
| 361 | int srcOffset, |
||
| 362 | java.nio.Buffer dst, |
||
| 363 | int numElements)</pre> |
||
| 364 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 365 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 366 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 367 | performed</b>.</div> |
||
| 368 | <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> |
||
| 369 | </li> |
||
| 370 | </ul> |
||
| 371 | <a name="copy(short[], int, java.nio.Buffer, int)"> |
||
| 372 | <!-- --> |
||
| 373 | </a> |
||
| 374 | <ul class="blockList"> |
||
| 375 | <li class="blockList"> |
||
| 376 | <h4>copy</h4> |
||
| 377 | <pre>public static void copy(short[] src, |
||
| 378 | int srcOffset, |
||
| 379 | java.nio.Buffer dst, |
||
| 380 | int numElements)</pre> |
||
| 381 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 382 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 383 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 384 | performed</b>.</div> |
||
| 385 | <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> |
||
| 386 | </li> |
||
| 387 | </ul> |
||
| 388 | <a name="copy(char[], int, java.nio.Buffer, int)"> |
||
| 389 | <!-- --> |
||
| 390 | </a> |
||
| 391 | <ul class="blockList"> |
||
| 392 | <li class="blockList"> |
||
| 393 | <h4>copy</h4> |
||
| 394 | <pre>public static void copy(char[] src, |
||
| 395 | int srcOffset, |
||
| 396 | java.nio.Buffer dst, |
||
| 397 | int numElements)</pre> |
||
| 398 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 399 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 400 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 401 | performed</b>.</div> |
||
| 402 | <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> |
||
| 403 | </li> |
||
| 404 | </ul> |
||
| 405 | <a name="copy(int[], int, java.nio.Buffer, int)"> |
||
| 406 | <!-- --> |
||
| 407 | </a> |
||
| 408 | <ul class="blockList"> |
||
| 409 | <li class="blockList"> |
||
| 410 | <h4>copy</h4> |
||
| 411 | <pre>public static void copy(int[] src, |
||
| 412 | int srcOffset, |
||
| 413 | java.nio.Buffer dst, |
||
| 414 | int numElements)</pre> |
||
| 415 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 416 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 417 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 418 | performed</b>.</div> |
||
| 419 | <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> |
||
| 420 | </li> |
||
| 421 | </ul> |
||
| 422 | <a name="copy(long[], int, java.nio.Buffer, int)"> |
||
| 423 | <!-- --> |
||
| 424 | </a> |
||
| 425 | <ul class="blockList"> |
||
| 426 | <li class="blockList"> |
||
| 427 | <h4>copy</h4> |
||
| 428 | <pre>public static void copy(long[] src, |
||
| 429 | int srcOffset, |
||
| 430 | java.nio.Buffer dst, |
||
| 431 | int numElements)</pre> |
||
| 432 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 433 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 434 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 435 | performed</b>.</div> |
||
| 436 | <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> |
||
| 437 | </li> |
||
| 438 | </ul> |
||
| 439 | <a name="copy(float[], int, java.nio.Buffer, int)"> |
||
| 440 | <!-- --> |
||
| 441 | </a> |
||
| 442 | <ul class="blockList"> |
||
| 443 | <li class="blockList"> |
||
| 444 | <h4>copy</h4> |
||
| 445 | <pre>public static void copy(float[] src, |
||
| 446 | int srcOffset, |
||
| 447 | java.nio.Buffer dst, |
||
| 448 | int numElements)</pre> |
||
| 449 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 450 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 451 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 452 | performed</b>.</div> |
||
| 453 | <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> |
||
| 454 | </li> |
||
| 455 | </ul> |
||
| 456 | <a name="copy(double[], int, java.nio.Buffer, int)"> |
||
| 457 | <!-- --> |
||
| 458 | </a> |
||
| 459 | <ul class="blockList"> |
||
| 460 | <li class="blockList"> |
||
| 461 | <h4>copy</h4> |
||
| 462 | <pre>public static void copy(double[] src, |
||
| 463 | int srcOffset, |
||
| 464 | java.nio.Buffer dst, |
||
| 465 | int numElements)</pre> |
||
| 466 | <div class="block">Copies the contents of src to dst, starting from src[srcOffset], copying numElements elements. The <code>Buffer</code> instance's |
||
| 467 | <code>Buffer.position()</code> is used to define the offset into the Buffer itself. The position will stay the same, the limit |
||
| 468 | will be set to position + numElements. <b>The Buffer must be a direct Buffer with native byte order. No error checking is |
||
| 469 | performed</b>.</div> |
||
| 470 | <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> |
||
| 471 | </li> |
||
| 472 | </ul> |
||
| 473 | <a name="copy(java.nio.Buffer, java.nio.Buffer, int)"> |
||
| 474 | <!-- --> |
||
| 475 | </a> |
||
| 476 | <ul class="blockList"> |
||
| 477 | <li class="blockList"> |
||
| 478 | <h4>copy</h4> |
||
| 479 | <pre>public static void copy(java.nio.Buffer src, |
||
| 480 | java.nio.Buffer dst, |
||
| 481 | int numElements)</pre> |
||
| 482 | <div class="block">Copies the contents of src to dst, starting from the current position of src, copying numElements elements (using the data |
||
| 483 | type of src, no matter the datatype of dst). The dst <code>Buffer.position()</code> is used as the writing offset. The position |
||
| 484 | 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 |
||
| 485 | to dst.position() + numElements, where numElements are translated to the number of elements appropriate for the dst Buffer |
||
| 486 | data type. <b>The Buffers must be direct Buffers with native byte order. No error checking is performed</b>.</div> |
||
| 487 | <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> |
||
| 488 | </li> |
||
| 489 | </ul> |
||
| 490 | <a name="newFloatBuffer(int)"> |
||
| 491 | <!-- --> |
||
| 492 | </a> |
||
| 493 | <ul class="blockList"> |
||
| 494 | <li class="blockList"> |
||
| 495 | <h4>newFloatBuffer</h4> |
||
| 496 | <pre>public static java.nio.FloatBuffer newFloatBuffer(int numFloats)</pre> |
||
| 497 | </li> |
||
| 498 | </ul> |
||
| 499 | <a name="newDoubleBuffer(int)"> |
||
| 500 | <!-- --> |
||
| 501 | </a> |
||
| 502 | <ul class="blockList"> |
||
| 503 | <li class="blockList"> |
||
| 504 | <h4>newDoubleBuffer</h4> |
||
| 505 | <pre>public static java.nio.DoubleBuffer newDoubleBuffer(int numDoubles)</pre> |
||
| 506 | </li> |
||
| 507 | </ul> |
||
| 508 | <a name="newByteBuffer(int)"> |
||
| 509 | <!-- --> |
||
| 510 | </a> |
||
| 511 | <ul class="blockList"> |
||
| 512 | <li class="blockList"> |
||
| 513 | <h4>newByteBuffer</h4> |
||
| 514 | <pre>public static java.nio.ByteBuffer newByteBuffer(int numBytes)</pre> |
||
| 515 | </li> |
||
| 516 | </ul> |
||
| 517 | <a name="newShortBuffer(int)"> |
||
| 518 | <!-- --> |
||
| 519 | </a> |
||
| 520 | <ul class="blockList"> |
||
| 521 | <li class="blockList"> |
||
| 522 | <h4>newShortBuffer</h4> |
||
| 523 | <pre>public static java.nio.ShortBuffer newShortBuffer(int numShorts)</pre> |
||
| 524 | </li> |
||
| 525 | </ul> |
||
| 526 | <a name="newCharBuffer(int)"> |
||
| 527 | <!-- --> |
||
| 528 | </a> |
||
| 529 | <ul class="blockList"> |
||
| 530 | <li class="blockList"> |
||
| 531 | <h4>newCharBuffer</h4> |
||
| 532 | <pre>public static java.nio.CharBuffer newCharBuffer(int numChars)</pre> |
||
| 533 | </li> |
||
| 534 | </ul> |
||
| 535 | <a name="newIntBuffer(int)"> |
||
| 536 | <!-- --> |
||
| 537 | </a> |
||
| 538 | <ul class="blockList"> |
||
| 539 | <li class="blockList"> |
||
| 540 | <h4>newIntBuffer</h4> |
||
| 541 | <pre>public static java.nio.IntBuffer newIntBuffer(int numInts)</pre> |
||
| 542 | </li> |
||
| 543 | </ul> |
||
| 544 | <a name="newLongBuffer(int)"> |
||
| 545 | <!-- --> |
||
| 546 | </a> |
||
| 547 | <ul class="blockList"> |
||
| 548 | <li class="blockList"> |
||
| 549 | <h4>newLongBuffer</h4> |
||
| 550 | <pre>public static java.nio.LongBuffer newLongBuffer(int numLongs)</pre> |
||
| 551 | </li> |
||
| 552 | </ul> |
||
| 553 | <a name="disposeUnsafeByteBuffer(java.nio.ByteBuffer)"> |
||
| 554 | <!-- --> |
||
| 555 | </a> |
||
| 556 | <ul class="blockList"> |
||
| 557 | <li class="blockList"> |
||
| 558 | <h4>disposeUnsafeByteBuffer</h4> |
||
| 559 | <pre>public static void disposeUnsafeByteBuffer(java.nio.ByteBuffer buffer)</pre> |
||
| 560 | </li> |
||
| 561 | </ul> |
||
| 562 | <a name="newUnsafeByteBuffer(int)"> |
||
| 563 | <!-- --> |
||
| 564 | </a> |
||
| 565 | <ul class="blockList"> |
||
| 566 | <li class="blockList"> |
||
| 567 | <h4>newUnsafeByteBuffer</h4> |
||
| 568 | <pre>public static java.nio.ByteBuffer newUnsafeByteBuffer(int numBytes)</pre> |
||
| 569 | <div class="block">Allocates a new direct ByteBuffer from native heap memory using the native byte order. Needs to be disposed with |
||
| 570 | <a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#freeMemory(java.nio.ByteBuffer)"><code>freeMemory(ByteBuffer)</code></a>.</div> |
||
| 571 | <dl><dt><span class="strong">Parameters:</span></dt><dd><code>numBytes</code> - </dd></dl> |
||
| 572 | </li> |
||
| 573 | </ul> |
||
| 574 | <a name="getUnsafeBufferAddress(java.nio.Buffer)"> |
||
| 575 | <!-- --> |
||
| 576 | </a> |
||
| 577 | <ul class="blockList"> |
||
| 578 | <li class="blockList"> |
||
| 579 | <h4>getUnsafeBufferAddress</h4> |
||
| 580 | <pre>public static long getUnsafeBufferAddress(java.nio.Buffer buffer)</pre> |
||
| 581 | <div class="block">Returns the address of the Buffer, it assumes it is an unsafe buffer.</div> |
||
| 582 | <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer</code> - The Buffer to ask the address for.</dd> |
||
| 583 | <dt><span class="strong">Returns:</span></dt><dd>the address of the Buffer.</dd></dl> |
||
| 584 | </li> |
||
| 585 | </ul> |
||
| 586 | <a name="newUnsafeByteBuffer(java.nio.ByteBuffer)"> |
||
| 587 | <!-- --> |
||
| 588 | </a> |
||
| 589 | <ul class="blockList"> |
||
| 590 | <li class="blockList"> |
||
| 591 | <h4>newUnsafeByteBuffer</h4> |
||
| 592 | <pre>public static java.nio.ByteBuffer newUnsafeByteBuffer(java.nio.ByteBuffer buffer)</pre> |
||
| 593 | <div class="block">Registers the given ByteBuffer as an unsafe ByteBuffer. The ByteBuffer must have been |
||
| 594 | allocated in native code, pointing to a memory region allocated via malloc. Needs to |
||
| 595 | be disposed with <a href="../../../../com/badlogic/gdx/utils/BufferUtils.html#freeMemory(java.nio.ByteBuffer)"><code>freeMemory(ByteBuffer)</code></a>.</div> |
||
| 596 | <dl><dt><span class="strong">Parameters:</span></dt><dd><code>buffer</code> - the <code>ByteBuffer</code> to register</dd> |
||
| 597 | <dt><span class="strong">Returns:</span></dt><dd>the ByteBuffer passed to the method</dd></dl> |
||
| 598 | </li> |
||
| 599 | </ul> |
||
| 600 | <a name="getAllocatedBytesUnsafe()"> |
||
| 601 | <!-- --> |
||
| 602 | </a> |
||
| 603 | <ul class="blockList"> |
||
| 604 | <li class="blockList"> |
||
| 605 | <h4>getAllocatedBytesUnsafe</h4> |
||
| 606 | <pre>public static int getAllocatedBytesUnsafe()</pre> |
||
| 607 | <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> |
||
| 608 | </li> |
||
| 609 | </ul> |
||
| 610 | <a name="clear(java.nio.ByteBuffer, int)"> |
||
| 611 | <!-- --> |
||
| 612 | </a> |
||
| 613 | <ul class="blockListLast"> |
||
| 614 | <li class="blockList"> |
||
| 615 | <h4>clear</h4> |
||
| 616 | <pre>public static void clear(java.nio.ByteBuffer buffer, |
||
| 617 | int numBytes)</pre> |
||
| 618 | <div class="block">Writes the specified number of zeros to the buffer. This is generally faster than reallocating a new buffer.</div> |
||
| 619 | </li> |
||
| 620 | </ul> |
||
| 621 | </li> |
||
| 622 | </ul> |
||
| 623 | </li> |
||
| 624 | </ul> |
||
| 625 | </div> |
||
| 626 | </div> |
||
| 627 | <!-- ========= END OF CLASS DATA ========= --> |
||
| 628 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
||
| 629 | <div class="bottomNav"><a name="navbar_bottom"> |
||
| 630 | <!-- --> |
||
| 631 | </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
||
| 632 | <!-- --> |
||
| 633 | </a> |
||
| 634 | <ul class="navList" title="Navigation"> |
||
| 635 | <li><a href="../../../../overview-summary.html">Overview</a></li> |
||
| 636 | <li><a href="package-summary.html">Package</a></li> |
||
| 637 | <li class="navBarCell1Rev">Class</li> |
||
| 638 | <li><a href="class-use/BufferUtils.html">Use</a></li> |
||
| 639 | <li><a href="package-tree.html">Tree</a></li> |
||
| 640 | <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
||
| 641 | <li><a href="../../../../index-all.html">Index</a></li> |
||
| 642 | <li><a href="../../../../help-doc.html">Help</a></li> |
||
| 643 | </ul> |
||
| 644 | <div class="aboutLanguage"><em>libgdx API</em></div> |
||
| 645 | </div> |
||
| 646 | <div class="subNav"> |
||
| 647 | <ul class="navList"> |
||
| 648 | <li><a href="../../../../com/badlogic/gdx/utils/BooleanArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Prev Class</span></a></li> |
||
| 649 | <li><a href="../../../../com/badlogic/gdx/utils/CharArray.html" title="class in com.badlogic.gdx.utils"><span class="strong">Next Class</span></a></li> |
||
| 650 | </ul> |
||
| 651 | <ul class="navList"> |
||
| 652 | <li><a href="../../../../index.html?com/badlogic/gdx/utils/BufferUtils.html" target="_top">Frames</a></li> |
||
| 653 | <li><a href="BufferUtils.html" target="_top">No Frames</a></li> |
||
| 654 | </ul> |
||
| 655 | <ul class="navList" id="allclasses_navbar_bottom"> |
||
| 656 | <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
||
| 657 | </ul> |
||
| 658 | <div> |
||
| 659 | <script type="text/javascript"><!-- |
||
| 660 | allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
||
| 661 | if(window==top) { |
||
| 662 | allClassesLink.style.display = "block"; |
||
| 663 | } |
||
| 664 | else { |
||
| 665 | allClassesLink.style.display = "none"; |
||
| 666 | } |
||
| 667 | //--> |
||
| 668 | </script> |
||
| 669 | </div> |
||
| 670 | <div> |
||
| 671 | <ul class="subNavList"> |
||
| 672 | <li>Summary: </li> |
||
| 673 | <li>Nested | </li> |
||
| 674 | <li>Field | </li> |
||
| 675 | <li><a href="#constructor_summary">Constr</a> | </li> |
||
| 676 | <li><a href="#method_summary">Method</a></li> |
||
| 677 | </ul> |
||
| 678 | <ul class="subNavList"> |
||
| 679 | <li>Detail: </li> |
||
| 680 | <li>Field | </li> |
||
| 681 | <li><a href="#constructor_detail">Constr</a> | </li> |
||
| 682 | <li><a href="#method_detail">Method</a></li> |
||
| 683 | </ul> |
||
| 684 | </div> |
||
| 685 | <a name="skip-navbar_bottom"> |
||
| 686 | <!-- --> |
||
| 687 | </a></div> |
||
| 688 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
||
| 689 | <p class="legalCopy"><small> |
||
| 690 | <div style="font-size:9pt"><i> |
||
| 691 | Copyright © 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com) |
||
| 692 | </i></div> |
||
| 693 | </small></p> |
||
| 694 | </body> |
||
| 695 | </html> |