-
-
[求助]String fXML = getXml(fbyte);
-
发表于: 2017-11-10 21:38 2235
-
public static void main(String[] args) throws Exception
{
fname =“C:\\1.xml”;
byte[] fbyte = readFile(fname);
String fXML = getXml(fbyte);
}
public static byte[] readFile(String aFileName)
{
FileInputStream fio = null;
byte[] abyte0 = (byte[])null;
try
{
fio = new FileInputStream(aFileName);
byte[] ftemp = new byte[8192];
ByteArrayOutputStream fbyteout = new ByteArrayOutputStream(8192);
int flen = 0;
while (flen >= 0)
{
flen = fio.read(ftemp);
if (flen > 0)
fbyteout.write(ftemp, 0, flen);
}
ftemp = fbyteout.toByteArray();
abyte0 = ftemp;
if (fio != null)
fio.close();
} catch (Exception localException) {
}
return abyte0;
}
{
if ((abytes == null) || (abytes.length <= 0))
return null;
byte[] ftemp = new byte[abytes.length];
for (int i = 0; i < ftemp.length; i++) {
ftemp[i] = ((byte)(abytes[i] ^ 0xFFFFFFFF));
}
EncodeBase64 fdecoder = new EncodeBase64();
String result = null;
try
{
result = new String(EncodeBase64.decode(new String(ftemp)), "UTF-8");
}
catch (Exception ex)
{
result = null;
}
return result;
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课