private static boolean canFreeDirectBuffer0() {
    if (isAndroid()) {
      return false;
    }

    return PlatformDependent0.canFreeDirectBuffer();
  }
  private static boolean isUnaligned0() {
    if (!hasUnsafe()) {
      return false;
    }

    return PlatformDependent0.isUnaligned();
  }
  private static boolean hasUnsafe0() {
    if (isAndroid()) {
      return false;
    }

    boolean noUnsafe = SystemPropertyUtil.getBoolean("io.netty.noUnsafe", false);
    if (noUnsafe) {
      return false;
    }

    // Legacy properties
    boolean tryUnsafe;
    if (SystemPropertyUtil.contains("io.netty.tryUnsafe")) {
      tryUnsafe = SystemPropertyUtil.getBoolean("io.netty.tryUnsafe", true);
    } else {
      tryUnsafe = SystemPropertyUtil.getBoolean("org.jboss.netty.tryUnsafe", true);
    }

    if (!tryUnsafe) {
      return false;
    }

    return PlatformDependent0.hasUnsafe();
  }
 public static long directBufferAddress(ByteBuffer buffer) {
   return PlatformDependent0.directBufferAddress(buffer);
 }
 public static void copyMemory(long srcAddr, long dstAddr, long length) {
   PlatformDependent0.copyMemory(srcAddr, dstAddr, length);
 }
 public static void putInt(long address, int value) {
   PlatformDependent0.putInt(address, value);
 }
 public static void putLong(long address, long value) {
   PlatformDependent0.putLong(address, value);
 }
 public static void putByte(long address, byte value) {
   PlatformDependent0.putByte(address, value);
 }
 public static void putShort(long address, short value) {
   PlatformDependent0.putShort(address, value);
 }
Example #10
0
 public static int getInt(long address) {
   return PlatformDependent0.getInt(address);
 }
Example #11
0
 public static long getLong(long address) {
   return PlatformDependent0.getLong(address);
 }
Example #12
0
 public static short getShort(long address) {
   return PlatformDependent0.getShort(address);
 }
Example #13
0
 public static byte getByte(long address) {
   return PlatformDependent0.getByte(address);
 }
Example #14
0
 public static long objectFieldOffset(Field field) {
   return PlatformDependent0.objectFieldOffset(field);
 }
Example #15
0
 public static Object getObject(Object object, long fieldOffset) {
   return PlatformDependent0.getObject(object, fieldOffset);
 }
Example #16
0
 /**
  * Try to deallocate the specified direct {@link ByteBuffer}. Please note this method does nothing
  * if the current platform does not support this operation or the specified buffer is not a direct
  * buffer.
  */
 public static void freeDirectBuffer(ByteBuffer buffer) {
   if (canFreeDirectBuffer() && buffer.isDirect()) {
     PlatformDependent0.freeDirectBuffer(buffer);
   }
 }