# Command

abstract class Command(var name: String = "", var commandId: Int, timeStamp: Int, streamId: Int = 0, basicHeader: BasicHeader) : RtmpMessage

Created by pedro on 8/04/21.

Represent packets like connect, createStream, play, pause... Can be encoded using AMF0 or AMF3

TODO use amf3 or amf0 depend of getType method

#### Inheritors

CommandAmf0
CommandAmf3

## Constructors

Command
Link copied to clipboard
constructor(name: String = "", commandId: Int, timeStamp: Int, streamId: Int = 0, basicHeader: BasicHeader)

## Properties

commandId
Link copied to clipboard
var commandId: Int
header
Link copied to clipboard
val header: RtmpHeader
name
Link copied to clipboard
var name: String

## Functions

getCode
Link copied to clipboard
abstract fun getCode(): String
getDescription
Link copied to clipboard
abstract fun getDescription(): String
getSize
Link copied to clipboard
open override fun getSize(): Int
getStreamId
Link copied to clipboard
abstract fun getStreamId(): Int
getType
Link copied to clipboard
abstract fun getType(): MessageType
readBody
Link copied to clipboard
abstract fun readBody(input: InputStream)
storeBody
Link copied to clipboard
abstract fun storeBody(): ByteArray
updateHeader
Link copied to clipboard
fun updateHeader(rtmpHeader: RtmpHeader)
writeBody
Link copied to clipboard
suspend fun writeBody(socket: RtmpSocket)
writeHeader
Link copied to clipboard
suspend fun writeHeader(socket: RtmpSocket)