org.mariadb.jdbc.internal.packet.read

## Class RawPacket

- java.lang.Object
- - org.mariadb.jdbc.internal.packet.read.RawPacket

    public final class RawPacket
    extends Object

Class to represent a raw stream as transferred over the wire. First we got 3 bytes specifying the actual length, then one byte stream sequence number and then n bytes with user data.

### Constructor Summary

Constructors
Constructor and Description
`RawPacket(ByteBuffer byteBuffer, int packetSeq)` create a raw stream.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`ByteBuffer` `getByteBuffer()` Get the byte buffer backing this stream.
`int` `getPacketSeq()` Get the package sequence number.
`static RawPacket` `nextReusablePacket(InputStream is, byte[] headerBuffer, byte[] reusableBuffer)` Fetch next stream.

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

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

### Constructor Detail

#### RawPacket

    public RawPacket(ByteBuffer byteBuffer,
                     int packetSeq)

create a raw stream.

Parameters:
  `byteBuffer` - the byte buffer containing the stream
  `packetSeq` - the stream sequence

### Method Detail

#### nextReusablePacket

    public static RawPacket nextReusablePacket(InputStream is,
                                               byte[] headerBuffer,
                                               byte[] reusableBuffer)
                                        throws IOException

Fetch next stream.

Parameters:
  `is` - inputStream
  `headerBuffer` - reusable headBuffer
  `reusableBuffer` - reusable main buffer
Returns:
  result in a rawPAcket
Throws:
  `IOException` - if a connection error occur

#### getByteBuffer

    public ByteBuffer getByteBuffer()

Get the byte buffer backing this stream.

Returns:
  a read only byte buffer

#### getPacketSeq

    public int getPacketSeq()

Get the package sequence number.

Returns:
  the sequence number of the package