Exemplo n.º 1
0
    // Pfm.FormatterDispatch.Write
    public void Write(Pfm.MarshallerWriteOp op)
    {
        long openId     = op.OpenId();
        long fileOffset = op.FileOffset();

        byte[] data          = op.Data();
        int    requestedSize = op.RequestedSize();
        int    perr;
        int    actualSize = 0;
        File   file;

        perr = FileFindOpenId(openId, out file);
        if (perr == 0)
        {
            try
            {
                actualSize = FileWrite(file, fileOffset, data, requestedSize);
            }
            catch (OutOfMemoryException)
            {
                perr = Pfm.errorNoSpace;
            }
        }

        op.Complete(perr, actualSize);
    }
Exemplo n.º 2
0
 public void Write(Pfm.MarshallerWriteOp op)
 {
     op.Complete(Pfm.errorAccessDenied, 0 /*actualSize*/);
 }