Take the tour ×  Is there any way to create class that extends
ByteBuffer class?  Some abstract methods from ByteBuffer are
package private, and if I create package java.nio, security
exception is thrown.  I would want to do that for performance
reasons - getInt for example has about 10 method invocations, as
well as quite a few if's. Even if all checks are left, and only
method calls are inlined and big/small endian checks are
removed, tests that I've created show that it can be about 4
times faster.  share|improve this question My top tips for NIO
buffer performance: Use -server, make your methods small (so
that they can be inlined into) and sometimes it's better to
switch to byte[]. –  Tom Hawtin - tackline Mar 9 '09 at 11:35
Similar question on thatsjava.com –  finnw May 27 '11 at 9:51
+50 bounty for a way to circumvent the access restriction (tt
cannot be done using reflection alone. Maybe there is a way
using sun.misc.Unsafe etc.?) –  finnw May 27 '11 at 9:53 @finnw,
which access restricton are you talk