Class Parcel

    Definition

    Namespace:
    Tizen.Applications.RPCPort
    Assembly:
    Tizen.Applications.Common.dll

    The class that helps to perform marshalling and unmarshalling for RPC.

    public class Parcel : IDisposable
    Inheritance
    object
    Parcel

    Constructors

    View Source

    Parcel()

    Constructor for this class.

    Declaration
    public Parcel()
    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    Parcel(bool)

    Constructs a new instance of the Parcel class.

    Declaration
    public Parcel(bool withHeader)
    Parameters
    Type Name Description
    bool withHeader

    Determines whether the created parcel object includes a header or not.

    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal I/O error occurs during the construction process.

    View Source

    Parcel(byte[])

    Constructs a new Parcel object from the specified raw bytes.

    Declaration
    public Parcel(byte[] bytes)
    Parameters
    Type Name Description
    byte[] bytes

    An array of bytes that represents the content of the parcel.

    View Source

    Parcel(Parcel, uint, uint)

    Constructs a sub parcel from origin parcel.

    Declaration
    public Parcel(Parcel origin, uint startPos, uint size)
    Parameters
    Type Name Description
    Parcel origin

    The origin parcel.

    uint startPos

    The start position from origin parcel.

    uint size

    The size of the new parcel.

    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    Parcel(Port)

    Creates a new parcel object from a specified port object.

    Declaration
    public Parcel(Port port)
    Parameters
    Type Name Description
    Port port

    The port object to create a parcel from.

    Exceptions
    Type Condition
    InvalidIOException

    An internal IO error occurred while creating the parcel.

    Methods

    View Source

    Dispose()

    Release all the resources used by the class Parcel.

    Declaration
    public void Dispose()
    View Source

    ~Parcel()

    Finalizer of the class Parcel.

    Declaration
    protected ~Parcel()
    View Source

    GetDataSize()

    Gets the size of the raw data of the parcel.

    Declaration
    public uint GetDataSize()
    Returns
    Type Description
    uint

    The size of data

    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    GetHeader()

    Gets header of rpc port parcel.

    Declaration
    public ParcelHeader GetHeader()
    Returns
    Type Description
    ParcelHeader

    Parcel header

    View Source

    GetReader()

    Gets the reader pointer of the parcel to the start.

    Declaration
    public uint GetReader()
    Returns
    Type Description
    uint

    The position of the reader

    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    Pin()

    Pin the memory. Once it is called, the capacity would not be changed.

    Declaration
    public void Pin()
    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    Read(int)

    Reads bytes from the parcel object.

    Declaration
    public byte[] Read(int size)
    Parameters
    Type Name Description
    int size

    The number of bytes to read.

    Returns
    Type Description
    byte[]

    An array of bytes that were read from the parcel.

    View Source

    ReadArrayCount()

    Reads a count of an array from a parcel object.

    Declaration
    public int ReadArrayCount()
    Returns
    Type Description
    int

    The number of elements in the array.

    View Source

    ReadBool()

    Reads a boolean value from the parcel object.

    Declaration
    public bool ReadBool()
    Returns
    Type Description
    bool

    The boolean data.

    View Source

    ReadBundle()

    Reads a Bundle value from the parcel object.

    Declaration
    public Bundle ReadBundle()
    Returns
    Type Description
    Bundle

    The Bundle data.

    View Source

    ReadByte()

    Reads a byte value from the parcel object.

    Declaration
    public byte ReadByte()
    Returns
    Type Description
    byte

    The byte value.

    View Source

    ReadDouble()

    Reads a double value from the parcel object.

    Declaration
    public double ReadDouble()
    Returns
    Type Description
    double

    The double data.

    View Source

    ReadFloat()

    Reads a float value from the parcel object.

    Declaration
    public float ReadFloat()
    Returns
    Type Description
    float

    The float data.

    View Source

    ReadInt()

    Reads an integer value from the parcel object.

    Declaration
    public int ReadInt()
    Returns
    Type Description
    int

    The integer data.

    View Source

    ReadLong()

    Reads a long value from the parcel object.

    Declaration
    public long ReadLong()
    Returns
    Type Description
    long

    The long data.

    View Source

    ReadSByte()

    Reads a signed byte value from the parcel object.

    Declaration
    public sbyte ReadSByte()
    Returns
    Type Description
    sbyte

    The byte value.

    View Source

    ReadShort()

    Reads a short value from the parcel object.

    Declaration
    public short ReadShort()
    Returns
    Type Description
    short

    The short data.

    View Source

    ReadString()

    Reads a string value from the parcel object.

    Declaration
    public string ReadString()
    Returns
    Type Description
    string

    The string data.

    View Source

    ReadUInt()

    Reads an unsigned integer value from the parcel object.

    Declaration
    public uint ReadUInt()
    Returns
    Type Description
    uint

    The integer data.

    View Source

    ReadULong()

    Reads an unsigned long value from the parcel object.

    Declaration
    public ulong ReadULong()
    Returns
    Type Description
    ulong

    The unsigned long data.

    View Source

    ReadUShort()

    Reads an unsigned short value from the parcel object.

    Declaration
    public ushort ReadUShort()
    Returns
    Type Description
    ushort

    The unsigned short data.

    View Source

    Reserve(uint)

    Reserves bytes to write later.

    The bytes to reserve.
    Declaration
    public void Reserve(uint size)
    Parameters
    Type Name Description
    uint size
    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    Send(Port)

    Sends parcel data through the specified port.

    Declaration
    public void Send(Port p)
    Parameters
    Type Name Description
    Port p
    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    SetDataSize(uint)

    Sets the size of the raw data of the parcel.

    Declaration
    public void SetDataSize(uint size)
    Parameters
    Type Name Description
    uint size

    The size of data.

    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    SetReader(uint)

    Sets the reader pointer of the parcel to the start.

    Declaration
    public void SetReader(uint pos)
    Parameters
    Type Name Description
    uint pos

    The position to read.

    Exceptions
    Type Condition
    InvalidIOException

    Thrown when an internal IO error occurs.

    View Source

    ToBytes()

    Converts the current parcel into its raw bytes representation.

    Declaration
    public byte[] ToBytes()
    Returns
    Type Description
    byte[]

    An array of bytes containing the contents of the parcel.

    Exceptions
    Type Condition
    InvalidIOException

    Thrown if an internal I/O error occurs during conversion.

    View Source

    Write(byte[])

    Writes bytes into the parcel object.

    Declaration
    public void Write(byte[] bytes)
    Parameters
    Type Name Description
    byte[] bytes

    An array of bytes containing the data to be written.

    View Source

    WriteArrayCount(int)

    Writes a count of an array into the parcel object.

    Declaration
    public void WriteArrayCount(int cnt)
    Parameters
    Type Name Description
    int cnt

    The number of elements in the array.

    View Source

    WriteBool(bool)

    Writes a boolean value into the parcel object.

    Declaration
    public void WriteBool(bool b)
    Parameters
    Type Name Description
    bool b

    The boolean value to write.

    View Source

    WriteBundle(Bundle)

    Writes a Bundle data into the parcel object.

    Declaration
    public void WriteBundle(Bundle b)
    Parameters
    Type Name Description
    Bundle b

    The Bundle object to write.

    View Source

    WriteByte(byte)

    Writes a single byte value into the parcel object.

    Declaration
    public void WriteByte(byte b)
    Parameters
    Type Name Description
    byte b

    The byte value to be written into the parcel object.

    View Source

    WriteDouble(double)

    Writes a double value into the parcel object.

    Declaration
    public void WriteDouble(double b)
    Parameters
    Type Name Description
    double b

    The double data to write.

    View Source

    WriteFloat(float)

    Writes a float value into the parcel object.

    Declaration
    public void WriteFloat(float b)
    Parameters
    Type Name Description
    float b

    The float data to write into the parcel object.

    View Source

    WriteInt(int)

    Writes an integer value into the parcel object.

    Declaration
    public void WriteInt(int b)
    Parameters
    Type Name Description
    int b

    The integer value to write.

    Examples

    Here's an example showing how to write an integer value into a parcel object:

    // Create a new parcel object
    Parcel parcel = new Parcel();
    
    // Write an integer value into the parcel object
    parcel.WriteInt(42);
    
    // Do something else with the parcel object...
    ...
    View Source

    WriteLong(long)

    Writes a long value into the parcel object.

    Declaration
    public void WriteLong(long b)
    Parameters
    Type Name Description
    long b

    The long data to write.

    View Source

    WriteSByte(sbyte)

    Writes a single signed byte value into the parcel object.

    Declaration
    public void WriteSByte(sbyte b)
    Parameters
    Type Name Description
    sbyte b

    The signed byte value to be written into the parcel object.

    View Source

    WriteShort(short)

    Writes a short value into parcel object.

    Declaration
    public void WriteShort(short b)
    Parameters
    Type Name Description
    short b

    The short data to write.

    View Source

    WriteString(string)

    Writes a string value into the parcel object.

    Declaration
    public void WriteString(string b)
    Parameters
    Type Name Description
    string b

    The string data to be written into the parcel object.

    View Source

    WriteUInt(uint)

    Writes an unsigned integer value into the parcel object.

    Declaration
    public void WriteUInt(uint b)
    Parameters
    Type Name Description
    uint b

    The unsigned integer value to write.

    View Source

    WriteULong(ulong)

    Writes an unsigned long value into the parcel object.

    Declaration
    public void WriteULong(ulong b)
    Parameters
    Type Name Description
    ulong b

    The unsigned long data to write.

    View Source

    WriteUShort(ushort)

    Writes a unsigned short value into parcel object.

    Declaration
    public void WriteUShort(ushort b)
    Parameters
    Type Name Description
    ushort b

    The unsigned short data to write.

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX