use DataHelper.skip() in a few more places

This commit is contained in:
zzz
2013-11-10 22:20:06 +00:00
parent 3fce0e8e45
commit 69489dd19e
2 changed files with 4 additions and 11 deletions

View File

@ -170,8 +170,7 @@ class PeerAcceptor
if (b != PROTO[i])
throw new IOException("Bad protocol 0x" + Integer.toHexString(b) + " at byte " + i);
}
if (in.skip(8) != 8)
throw new IOException("EOF before hash");
DataHelper.skip(in, 8);
byte buf[] = new byte[20];
int read = DataHelper.read(in, buf);
if (read != buf.length)