EOFException DataInputStream.readFully

时间:2017-12-15 12:38:43

标签: java datainputstream

基本上我正在帮助我的一个朋友,

他的游戏(runescape私人服务器)出现断线错误,并且有一个错误不断被抛出,这是

Client.streamLoaderForName(Client.java:7343)

while(in.available() > 0)

我使用 private CacheArchive streamLoaderForName(int i, String s, String s1, int j, int k) { byte abyte0[] = null; int l = 5; try { if(cacheIndices[0] != null) abyte0 = cacheIndices[0].get(i); } catch(Exception _ex) { } if(abyte0 != null) { CacheArchive streamLoader = new CacheArchive(abyte0); return streamLoader; } int j1 = 0; while(abyte0 == null) { String s2 = "Unknown error"; setLoadingText(k, "Requesting " + s); Object obj = null; try { int k1 = 0; DataInputStream datainputstream = jaggrabRequest(s1 + j); byte[] abyte1 = new byte[6]; datainputstream.readFully(abyte1, 0, 6); Stream stream = new Stream(abyte1); stream.currentOffset = 3; int i2 = stream.read3Bytes() + 6; int j2 = 6; abyte0 = new byte[i2]; System.arraycopy(abyte1, 0, abyte0, 0, 6); while(j2 < i2) { int l2 = i2 - j2; if(l2 > 1000) l2 = 1000; int j3 = datainputstream.read(abyte0, j2, l2); if(j3 < 0) { s2 = "Length error: " + j2 + "/" + i2; throw new IOException("EOF"); } j2 += j3; int k3 = (j2 * 100) / i2; k1 = k3; } datainputstream.close(); try { if(cacheIndices[0] != null) cacheIndices[0].put(abyte0.length, abyte0, i); } catch(Exception _ex) { cacheIndices[0] = null; } } catch(IOException ioexception) { ioexception.printStackTrace(); if(s2.equals("Unknown error")) s2 = "Connection error"; abyte0 = null; } catch(NullPointerException _ex) { s2 = "Null error"; abyte0 = null; } catch(ArrayIndexOutOfBoundsException _ex) { s2 = "Bounds error"; abyte0 = null; } catch(Exception _ex) { s2 = "Unexpected error"; abyte0 = null; } if(abyte0 == null) { for(int l1 = l; l1 > 0; l1--) { if(j1 >= 3) { setLoadingText(k, "Game updated - please reload page"); l1 = 10; } else { setLoadingText(k, s2 + " - Retrying in " + l1); } try { Thread.sleep(1000L); } catch(Exception _ex) { } } l *= 2; if(l > 60) l = 60; } } CacheArchive streamLoader_1 = new CacheArchive(abyte0); return streamLoader_1; } 阅读了一些内容,但我不知道它放在哪里。 这是发生错误的方法

datainputstream.readFully(abyte1, 0, 6);  

我似乎无法找到在何处进行任何展示位置或如何修复此错误。顺便说一句,7343的行是

 var data = await getRepository(User)
                  .createQueryBuilder("user")
                  .where("user.firstName like :name", {name: '%' + firstName + '%' })
                  .getMany();

对于糟糕的线程也很抱歉,我不知道如何正确地写这个。

0 个答案:

没有答案
相关问题