MoonIsolatedStorageFileStream.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //
  2. // System.IO.IsolatedStorage.MoonIsolatedStorageFileStream
  3. //
  4. // Moonlight's implementation for the IsolatedStorageFileStream
  5. //
  6. // Authors
  7. // Miguel de Icaza ([email protected])
  8. //
  9. // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. #if NET_2_1
  31. using System;
  32. using System.IO;
  33. namespace System.IO.IsolatedStorage {
  34. public class IsolatedStorageFileStream : FileStream {
  35. IsolatedStorageFile container;
  36. public IsolatedStorageFileStream (string path, FileMode mode, IsolatedStorageFile isf)
  37. : base (IsolatedStorageFile.Verify (path), mode)
  38. {
  39. container = isf;
  40. }
  41. public IsolatedStorageFileStream (string path, FileMode mode, FileAccess access, IsolatedStorageFile isf)
  42. : base (IsolatedStorageFile.Verify (path), mode, access)
  43. {
  44. container = isf;
  45. }
  46. public IsolatedStorageFileStream (string path, FileMode mode, FileAccess access, FileShare share, IsolatedStorageFile isf)
  47. : base (IsolatedStorageFile.Verify (path), mode, access, share)
  48. {
  49. container = isf;
  50. }
  51. protected override void Dispose (bool disposing)
  52. {
  53. base.Dispose (disposing);
  54. }
  55. public override void Flush ()
  56. {
  57. base.Flush ();
  58. }
  59. public override int Read (byte [] buffer, int offset, int count)
  60. {
  61. return base.Read (buffer, offset, count);
  62. }
  63. public override int ReadByte ()
  64. {
  65. return base.ReadByte ();
  66. }
  67. public override long Seek (long offset, SeekOrigin origin)
  68. {
  69. return base.Seek (offset, origin);
  70. }
  71. public override void SetLength (long value)
  72. {
  73. base.SetLength (value);
  74. }
  75. public override void Write (byte [] buffer, int offset, int count)
  76. {
  77. base.Write (buffer, offset, count);
  78. }
  79. public override void WriteByte (byte value)
  80. {
  81. WriteByte (value);
  82. }
  83. public override bool CanRead {
  84. get {
  85. return base.CanRead;
  86. }
  87. }
  88. public override bool CanSeek {
  89. get {
  90. return base.CanSeek;
  91. }
  92. }
  93. public override bool CanWrite {
  94. get {
  95. return base.CanWrite;
  96. }
  97. }
  98. public override bool IsAsync {
  99. get {
  100. return base.IsAsync;
  101. }
  102. }
  103. public override long Length {
  104. get {
  105. return base.Length;
  106. }
  107. }
  108. public override long Position {
  109. get {
  110. return base.Position;
  111. }
  112. set {
  113. base.Position = value;
  114. }
  115. }
  116. }
  117. }
  118. #endif