KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > util > runtime > IOFlavor


1 /**
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.util.runtime;
5
6 /**
7  * @author teck
8  */

9 public class IOFlavor {
10
11   private static boolean forceJDK13 = false;
12
13   public static void forceJDK13() {
14     forceJDK13 = true;
15   }
16
17   public static boolean isNioAvailable() {
18     if (forceJDK13) { return false; }
19
20     try {
21       Class.forName("java.nio.ByteBuffer");
22     } catch (ClassNotFoundException JavaDoc e) {
23       return false;
24     }
25
26     return true;
27   }
28
29 }
Popular Tags