Esempio n. 1
0
        private unsafe long writeSynchronous(fastCSharp.code.cSharp.tcpBase.subByteUnmanagedStream dataStream)
        {
            if (fileStream != null)
            {
                subArray <byte> buffer = dataStream.Buffer;
                if (buffer.length != 0)
                {
                    fixed(byte *bufferFixed = buffer.array)
                    {
                        byte *start = bufferFixed - sizeof(int);

                        *(int *)start = buffer.length;
                        return(fileStream.UnsafeWrite(start, buffer.length + (-buffer.length & 3) + sizeof(int)));
                    }
                }
            }
            return(-1);
        }
Esempio n. 2
0
        private unsafe void write(fastCSharp.code.cSharp.tcpBase.subByteUnmanagedStream dataStream, Func <fastCSharp.net.returnValue <long>, bool> onReturn)
        {
            if (fileStream != null)
            {
                subArray <byte> buffer = dataStream.Buffer;
                if (buffer.length != 0)
                {
                    fixed(byte *bufferFixed = buffer.array)
                    {
                        byte *start = bufferFixed - sizeof(int);

                        *(int *)start = buffer.length;
                        fileStream.UnsafeWrite(start, buffer.length + (-buffer.length & 3) + sizeof(int), onReturn);
                        return;
                    }
                }
            }
            onReturn(-1);
        }
Esempio n. 3
0
        private unsafe int append(fastCSharp.code.cSharp.tcpBase.subByteUnmanagedStream dataStream)
        {
            timeIdentity identity = getIdentity(ref dataStream.Buffer);

            return(dataStream.Buffer.array != null?physicalSet.Default.Append(identity.GetIdentity(), ref dataStream.Buffer) : 0);
        }
Esempio n. 4
0
        private bool create(fastCSharp.code.cSharp.tcpBase.subByteUnmanagedStream stream)
        {
            timeIdentity identity = getIdentity(ref stream.Buffer);

            return(stream.Buffer.array != null && physicalSet.Default.Create(identity.GetIdentity(), ref stream.Buffer));
        }