Package JP. co. Hitachi. gemplanet2.base. Controller;
Import java. Io. bufferedreader;
Import java. Io. file;
Import java. Io. filereader;
Import java. Io. unsupportedencodingexception;
Import java. util. arraylist;
Import java. util. stringtokenizer;
Import java. NiO. charset. charset;
Import java. NiO .*;
Public class test {
Public static void main (string [] ARGs ){
String temp = "";
// Arraylist slist = tofilelayoutlist (tempstr );
// System. Out. println (slist );
Charset cs = charset. forname ("UTF-8 ");
Bytebuffer BB = cs. encode (temp );
String S1 = "";
String S2 = "";
Bytebuffer BB2;
Bytebuffer bb3;
Try {
Byte [] result = new byte [temp. getbytes ("UTF-8"). Length];
BB2 = BB. Get (result, 0, 4 );
S1 = new string (result, "UTF-8 ");
BB2 = bb2.get (result, 0, 4 );
S2 = new string (result, "UTF-8 ");
System. Out. println (temp. getbytes ("UTF-8"). Length );
} Catch (exception e ){
}
System. Out. println (S1 );
System. Out. println (S2 );
//
Try {
Byte [] result2 = s1.getbytes ("UTF-8 ");
Byte [] result3 = s2.getbytes ("UTF-8 ");
Bb3 = bytebuffer. Allocate (result2.length + result3.length );
Bb3.put (result2 );
Bb3.put (result3 );
// Byte [] result4 = new byte [BB. Array (). Length];
Byte [] result = bb3.array ();
String STR = new string (result, "UTF-8 ");
System. Out. println (STR );
} Catch (exception E1 ){
// Todo automatically generates automatically generated writable catch writable
E1.printstacktrace ();
}
}
// Private Static arraylist tofilelayoutlist (string str_data_file_layout ){
// String rsv_item_text = "";
// Arraylist rsv_item_textlist = new arraylist (20 );
// String strtemp = str_data_file_layout;
// For (INT I = 0; I <20; I ++ ){
//
// If (strtemp. Length ()> = 5 ){
// Rsv_item_textlist.add (strtemp. substring (0, 4 ));
//
// Strtemp = strtemp. substring (4, strtemp. Length ());
//
//} Else {
// If (strtemp. Length ()> 0 ){
// Rsv_item_textlist.add (strtemp. substring (0, strtemp. Length ()));
// Strtemp = "";
//} Else {
// Rsv_item_textlist.add ("");
//}
//}
//}
// Return rsv_item_textlist;
//}
}