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 void |
readFully(InputStream stream,
byte[] b) |
static void |
readFully(InputStream stream,
byte[] b,
int off,
int len)
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 void readFully(InputStream stream, byte[] b, int off, int len) throws IOException
stream
- the input stream to read fromb
- buffer where to store the dataoff
- offset in the bufferlen
- bytes to readIOException
- if an error occurs while reading the stream.
java.io.EOFException of end of stream is hit.public static void readFully(InputStream stream, byte[] b) throws IOException
IOException
public static boolean eofIsNext(RawPacket rawPacket)
rawPacket
- the raw packetpublic static boolean isErrorPacket(RawPacket rawPacket)
Copyright © 2015. All rights reserved.