public byte[] GetResourceData() { if (this.stream != null) { return(EmbeddedResource.ReadStream(this.stream)); } if (this.data != null) { return(this.data); } if (!this.offset.HasValue) { throw new InvalidOperationException(); } return(this.reader.GetManagedResourceStream(this.offset.Value).ToArray()); }