Map propertys = new HashMap(length);
String[] csvItem = csv.readLineAsArray();
for (int i = 0; i < length; i++) {
propertys.put((String) names.get(i), csvItem[i]);
}
result.add(propertys);
}
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
}
Java井SLG嗄老蝕窟--方象議響函式隠贋(3)
扮寂:2011-03-14 51cto鴬人 cping
聞喘圭隈?
1. friends = (Friend[]) CSVConfigure.loadPropertys(FRIEND_FILE_NAME,
2. Friend.class);
峪頁匯倖載酒汽議郡符?祥辛參繍CSV燕鯉方象廣符欺窃貧。
壅傍匯和嗄老方象議贋刈?匯違栖讐祥頁峺嗄老芝村?宸壓Java嶄頁恷挫一議。咀葎峪勣低議購囚方象斤?糞?serializable?寄辛參岷俊繍輝念彜蓑會双晒欺云仇猟周嶄?音狛頁ObjectInputStream才ObjectOutputStream議委老意阻。
泌惚短嗤賜宀低音?議三?低峪勣繍購囚方象參蝶嶽鯉塀隠贋?宸倖寔頁昧宴?嬬壅響竃栖祥撹??隼朔壅郡澄公嗄老軸辛。糞縞貧厘断脅岑祇侭僚響亀/隠贋旺音頁扮寂寔議嶷栖阻?遇頁方象瓜珊圻意阻。
喘箭旗鷹?
package org.loon.simple.slg.utils;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
/**
*
* Copyright 2008
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*
* @project loonframework
* @author chenpeng
* @email?ceponline@yahoo.com.cn
* @version 0.1
*/
public class Keep {
private static final long serialVersionUID = -1982090153295778606L;
final static public String LS = System.getProperty("line.separator", "\n");
final static public String FS = System.getProperty("file.separator", "\\");
|