test/sun/nio/cs/OLD/TestIBMDB.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 6843578
  27  * @summary Test IBM DB charsets
  28  * @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD

  29  */
  30 
  31 import java.nio.charset.*;
  32 import java.nio.*;
  33 import java.util.*;
  34 
  35 public class TestIBMDB {
  36     static class Time {
  37         long t;
  38     }
  39     static int iteration = 200;
  40 
  41     static char[] decode(byte[] bb, Charset cs, boolean testDirect, Time t)
  42         throws Exception {
  43         String csn = cs.name();
  44         CharsetDecoder dec = cs.newDecoder();
  45         ByteBuffer bbf;
  46         CharBuffer cbf;
  47         if (testDirect) {
  48             bbf = ByteBuffer.allocateDirect(bb.length);




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 6843578
  27  * @summary Test IBM DB charsets
  28  * @build IBM930_OLD IBM933_OLD IBM935_OLD IBM937_OLD IBM939_OLD IBM942_OLD IBM943_OLD IBM948_OLD IBM949_OLD IBM950_OLD IBM970_OLD IBM942C_OLD IBM943C_OLD IBM949C_OLD IBM1381_OLD IBM1383_OLD EUC_CN_OLD EUC_KR_OLD GBK_OLD Johab_OLD MS932_OLD MS936_OLD MS949_OLD MS950_OLD
  29  * @run main TestIBMDB
  30  */
  31 
  32 import java.nio.charset.*;
  33 import java.nio.*;
  34 import java.util.*;
  35 
  36 public class TestIBMDB {
  37     static class Time {
  38         long t;
  39     }
  40     static int iteration = 200;
  41 
  42     static char[] decode(byte[] bb, Charset cs, boolean testDirect, Time t)
  43         throws Exception {
  44         String csn = cs.name();
  45         CharsetDecoder dec = cs.newDecoder();
  46         ByteBuffer bbf;
  47         CharBuffer cbf;
  48         if (testDirect) {
  49             bbf = ByteBuffer.allocateDirect(bb.length);