Beispiel #1
0
        public virtual bool Deserialize(XDR xdr)
        {
            if (!XDR.VerifyLength(xdr, 32))
            {
                return(false);
            }
            int size = xdr.ReadInt();

            handle = xdr.ReadFixedOpaque(size);
            fileId = BytesToLong(handle);
            return(true);
        }
Beispiel #2
0
        /// <exception cref="System.IO.IOException"/>
        public static Org.Apache.Hadoop.Nfs.Nfs3.Request.WRITE3Request Deserialize(XDR xdr
                                                                                   )
        {
            FileHandle handle = ReadHandle(xdr);
            long       offset = xdr.ReadHyper();
            int        count  = xdr.ReadInt();

            Nfs3Constant.WriteStableHow stableHow = Nfs3Constant.WriteStableHow.FromValue(xdr
                                                                                          .ReadInt());
            ByteBuffer data = ByteBuffer.Wrap(xdr.ReadFixedOpaque(xdr.ReadInt()));

            return(new Org.Apache.Hadoop.Nfs.Nfs3.Request.WRITE3Request(handle, offset, count
                                                                        , stableHow, data));
        }
Beispiel #3
0
        public static Org.Apache.Hadoop.Nfs.Nfs3.Response.READ3Response Deserialize(XDR xdr
                                                                                    )
        {
            int status = xdr.ReadInt();

            xdr.ReadBoolean();
            Nfs3FileAttributes postOpAttr = Nfs3FileAttributes.Deserialize(xdr);
            int  count = 0;
            bool eof   = false;

            byte[] data = new byte[0];
            if (status == Nfs3Status.Nfs3Ok)
            {
                count = xdr.ReadInt();
                eof   = xdr.ReadBoolean();
                int len = xdr.ReadInt();
                System.Diagnostics.Debug.Assert((len == count));
                data = xdr.ReadFixedOpaque(count);
            }
            return(new Org.Apache.Hadoop.Nfs.Nfs3.Response.READ3Response(status, postOpAttr,
                                                                         count, eof, ByteBuffer.Wrap(data)));
        }