public final class ReadUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
eofIsNext(RawPacket rawPacket)
Checks whether the next packet is EOF.
|
static boolean |
isErrorPacket(RawPacket rawPacket) |
static int |
safeRead(InputStream inputStream,
byte[] buffer)
Read a number of bytes from the stream and store it in the buffer, and fix the problem with "incomplete" reads by
doing another read if we don't have all of the data yet.
|
public static int safeRead(InputStream inputStream, byte[] buffer) throws IOException
inputStream - the input stream to read frombuffer - where to store the dataIOException - if an error occurs while reading the streampublic static boolean eofIsNext(RawPacket rawPacket)
rawPacket - the raw packetpublic static boolean isErrorPacket(RawPacket rawPacket)
Copyright © 2016. All rights reserved.