[This is preliminary documentation and subject to change.]
Creates a PDU with the given code byte, optional headers, and optional Stream to read into a body header. Creates the PDU in the the specified buffer.
Body header to the end of the PDU. If supplied, there must be no Body or EndOfBody header in the headers collection. Note: If there is not room for at least one byte of body content to be added to the PDU, then reading content from the stream is skipped.
An instance of ObexCreatedPdu containing the created PDU as a byte array.
| Exception Type | Condition |
|---|---|
| ArgumentNullException |
buffer is null. |
| ArgumentException |
– or –
|
| ObexCreateTooLongException | The buffer was too small to contain the created PDU containing even the first of the headers. As noted above, if at least one header _was_ written, then the PDU is returned, and the headers that were not added remain in the headers collection. |
| IOException | An error occured on reading from bodyStream |
ObexPduFactory Class | Brecham.Obex.Pdus Namespace | ObexPduFactory.Create Overload List