日期:2014-05-17  浏览次数:20634 次

文件上传中,getStream().read()的一个问题
本帖最后由 tianxiexingyun 于 2013-03-06 14:18:01 编辑

m_totalBytes = m_request.getContentLength();
m_binArray = new byte[m_totalBytes];
int j=0;//
for (; i < m_totalBytes; i += j) {//
try {
m_request.getInputStream();
j = m_request.getInputStream().read(m_binArray, i, m_totalBytes-i);
} catch (Exception exception) {
throw new SmartUploadException("Unable to upload.");
}
}

for (; !flag1 && m_currentIndex < m_totalBytes; m_currentIndex++) {
if (m_binArray[m_currentIndex] == 13){
flag1 = true;
} else {
m_boundary = m_boundary + (char) m_binArray[m_currentIndex];
}
}

不理解第十四行“m_binArray[m_currentIndex] == 13”是什么意思.还请高手指教。
源码是反编译的jspsmartupload。
出自SmartUpload.Java中的方法upload().
这里的13给人的感觉像是魔术数


------解决方案--------------------
老兄  我想 是 这个意思 : 判断这个字符是不是ASCII码是不是13(换行符)