Esempio n. 1
0
        public Stat(byte[] bytes)
        {
            var offset = 0;

            Size    = Protocol.ReadUShort(bytes, offset);
            offset += Constants.Bit16Sz;
            Type    = Protocol.ReadUShort(bytes, offset);
            offset += Constants.Bit16Sz;
            Dev     = Protocol.ReadUInt(bytes, offset);
            offset += Constants.Bit32Sz;
            Qid     = Protocol.ReadQid(bytes, offset);
            offset += Constants.Qidsz;
            Mode    = Protocol.ReadUInt(bytes, offset);
            offset += Constants.Bit32Sz;
            Atime   = Protocol.ReadUInt(bytes, offset);
            offset += Constants.Bit32Sz;
            Mtime   = Protocol.ReadUInt(bytes, offset);
            offset += Constants.Bit32Sz;
            Length  = Protocol.ReadULong(bytes, offset);
            offset += Constants.Bit64Sz;
            Name    = Protocol.ReadString(bytes, offset);
            offset += (int)Protocol.GetStringLength(Name);
            Uid     = Protocol.ReadString(bytes, offset);
            offset += (int)Protocol.GetStringLength(Uid);
            Gid     = Protocol.ReadString(bytes, offset);
            offset += (int)Protocol.GetStringLength(Gid);
            Muid    = Protocol.ReadString(bytes, offset);
            offset += (int)Protocol.GetStringLength(Muid);
            if (offset < Size)
            {
                throw new Exception("Too much data");
            }
        }
Esempio n. 2
0
        protected Message(byte[] bytes)
        {
            var offset = 0;

            Length  = Protocol.ReadUInt(bytes, offset);
            offset += Constants.Bit32Sz;
            Type    = bytes[offset];
            offset += Constants.Bit8Sz;
            Tag     = Protocol.ReadUShort(bytes, offset);
        }
Esempio n. 3
0
File: Qid.cs Progetto: forki/Sharp9P
        public Qid(byte[] bytes)
        {
            var offset = 0;

            Type    = bytes[offset];
            offset += Constants.Bit8Sz;
            Vers    = Protocol.ReadUInt(bytes, offset);
            offset += Constants.Bit32Sz;
            Path    = Protocol.ReadULong(bytes, offset);
        }