org.mariadb.jdbc.internal.common.packet.buffer

## Class ReadUtil

- java.lang.Object
- - org.mariadb.jdbc.internal.common.packet.buffer.ReadUtil

    public final class ReadUtil
    extends Object

### Method Summary

Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### readFully

    public static void readFully(InputStream stream,
                 byte[] b,
                 int off,
                 int len)
                          throws IOException

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.

Parameters:
  `stream` - the input stream to read from
  `b` - buffer where to store the data
  `off` - offset in the buffer
  `len` - bytes to read
Throws:
  `IOException` - if an error occurs while reading the stream. java.io.EOFException of end of stream is hit.

#### readFully

    public static void readFully(InputStream stream,
                 byte[] b)
                          throws IOException

Throws:
  `IOException`

#### eofIsNext

    public static boolean eofIsNext(RawPacket rawPacket)

Checks whether the next packet is EOF.

Parameters:
  `rawPacket` - the raw packet
Returns:
  true if the packet is an EOF packet

#### isErrorPacket

    public static boolean isErrorPacket(RawPacket rawPacket)