//int rpc_port_parcel_create_from_raw(rpc_port_parcel_h *h, const void *raw, unsigned int size);
[DllImport(Libraries.RpcPort, EntryPoint = "rpc_port_parcel_create_from_raw")]
internal static extern ErrorCode CreateFromRaw(out IntPtr parcelHandle, byte[] raw, uint size);
+
+ //int rpc_port_parcel_create_without_header(rpc_port_parcel_h *h);
+ [DllImport(Libraries.RpcPort, EntryPoint = "rpc_port_parcel_create_without_header")]
+ internal static extern ErrorCode CreateWithoutHeader(out IntPtr parcelHandle);
}
internal static partial class Proxy
/// <summary>
/// Constructor for this class.
/// </summary>
+ /// <param name="withHeader">If it's false, the parcel object does not have the header.</param>
+ /// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
+ /// <since_tizen> 11 </since_tizen>
+ public Parcel(bool withHeader)
+ {
+ Interop.LibRPCPort.ErrorCode error;
+ if (withHeader)
+ {
+ error = Interop.LibRPCPort.Parcel.Create(out _handle);
+ if (error != Interop.LibRPCPort.ErrorCode.None)
+ throw new InvalidIOException();
+ }
+ else
+ {
+ error = Interop.LibRPCPort.Parcel.CreateWithoutHeader(out _handle);
+ if (error != Interop.LibRPCPort.ErrorCode.None)
+ throw new InvalidIOException();
+ }
+ }
+
+ /// <summary>
+ /// Constructor for this class.
+ /// </summary>
/// <exception cref="InvalidIOException">Thrown when an internal IO error occurs.</exception>
/// <since_tizen> 5 </since_tizen>
- public Parcel()
+ public Parcel() : this(true)
{
- var r = Interop.LibRPCPort.Parcel.Create(out _handle);
- if (r != Interop.LibRPCPort.ErrorCode.None)
- throw new InvalidIOException();
}
/// <summary>