byte[] buff = new byte[1024];
open file inputstream, fis;
open socket outputstream sos;
int read = 0;
while ((read = fis.read(buff)) != -1) {
sos.write(buff);
}
fis.close();
sos.close();
open file inputstream, fis;
open socket outputstream sos;
int read = 0;
while ((read = fis.read(buff)) != -1) {
sos.write(buff);
}
fis.close();
sos.close();
你好,很高兴能得到你的指导,我还是初级开发者,可能提的问题和回答会有些初级,你能否给出example?
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 开小点,如果是socket方面的话,4K是不错的选择。
open file inputstream, fis;
open socket outputstream sos;
int read = 0;
while ((read = fis.read(buff)) != -1) {
sos.write(buff);
}
fis.close();
sos.close();
也是outofmemory啊