Revision: 44864
http://brlcad.svn.sourceforge.net/brlcad/?rev=44864&view=rev
Author: davidloman
Date: 2011-06-09 12:05:06 +0000 (Thu, 09 Jun 2011)
Log Message:
-----------
Move ByteBuffer resize functions into ByteBufferUtils
Modified Paths:
--------------
geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/net/ByteBufferUtils.java
Modified:
geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/net/ByteBufferUtils.java
===================================================================
---
geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/net/ByteBufferUtils.java
2011-06-09 12:03:46 UTC (rev 44863)
+++
geomcore/trunk/src/interfaces/java/src/org/brlcad/geometryservice/net/ByteBufferUtils.java
2011-06-09 12:05:06 UTC (rev 44864)
@@ -144,4 +144,19 @@
}
}
+ public static final ByteBuffer doubleBufCapacity(ByteBuffer bb) {
+ return ByteBufferUtils.multiplyBufCapacity(bb, 2);
+ }
+
+ public static final ByteBuffer multiplyBufCapacity(ByteBuffer bb, int
multi) {
+ int cap = bb.capacity();
+ cap *= multi;
+
+ ByteBuffer newBB = ByteBuffer.allocate(cap);
+ bb.flip();
+ newBB.put(bb);
+
+ return newBB;
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits