}
rtmp.setLastReadHeader(channelId, header);
// check to see if this is a new packets or continue decoding an existing one
Packet packet = rtmp.getLastReadPacket(channelId);
if (packet == null) {
packet = new Packet(header.clone());
rtmp.setLastReadPacket(channelId, packet);
}
final IoBuffer buf = packet.getData();
final int readRemaining = header.getSize() - buf.position();
final int chunkSize = rtmp.getReadChunkSize();