public bool Equals(Nfs3ReadResult other) { if (other == null) { return(false); } return(other.Status == Status && object.Equals(other.FileAttributes, FileAttributes) && other.Count == Count #if !NET20 && Enumerable.SequenceEqual(other.Data, Data) #endif && other.Eof == Eof); }
public Nfs3ReadResult Read(Nfs3FileHandle fileHandle, long position, int count) { Nfs3ReadResult result = _nfsClient.Read(fileHandle, position, count); if (result.FileAttributes != null) { _cachedAttributes[fileHandle] = result.FileAttributes; } if (result.Status == Nfs3Status.Ok) { return(result); } throw new Nfs3Exception(result.Status); }
public override int Read(byte[] buffer, int offset, int count) { int numToRead = (int)Math.Min(_client.FileSystemInfo.ReadMaxBytes, count); Nfs3ReadResult readResult = _client.Read(_handle, _position, numToRead); int toCopy = Math.Min(count, readResult.Count); Array.Copy(readResult.Data, 0, buffer, offset, toCopy); if (readResult.Eof) { _length = _position + readResult.Count; } _position += toCopy; return(toCopy); }