Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

Microsoft.IO.RecyclableMemoryStream.xml 55KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>Microsoft.IO.RecyclableMemoryStream</name>
  5. </assembly>
  6. <members>
  7. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager">
  8. <summary>
  9. Manages pools of RecyclableMemoryStream objects.
  10. </summary>
  11. <remarks>
  12. There are two pools managed in here. The small pool contains same-sized buffers that are handed to streams
  13. as they write more data.
  14. For scenarios that need to call GetBuffer(), the large pool contains buffers of various sizes, all
  15. multiples/exponentials of LargeBufferMultiple (1 MB by default). They are split by size to avoid overly-wasteful buffer
  16. usage. There should be far fewer 8 MB buffers than 1 MB buffers, for example.
  17. </remarks>
  18. </member>
  19. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.Events">
  20. <summary>
  21. ETW events for RecyclableMemoryStream
  22. </summary>
  23. </member>
  24. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.Events.Writer">
  25. <summary>
  26. Static log object, through which all events are written.
  27. </summary>
  28. </member>
  29. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamBufferType">
  30. <summary>
  31. Type of buffer
  32. </summary>
  33. </member>
  34. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamBufferType.Small">
  35. <summary>
  36. Small block buffer
  37. </summary>
  38. </member>
  39. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamBufferType.Large">
  40. <summary>
  41. Large pool buffer
  42. </summary>
  43. </member>
  44. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason">
  45. <summary>
  46. The possible reasons for discarding a buffer
  47. </summary>
  48. </member>
  49. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason.TooLarge">
  50. <summary>
  51. Buffer was too large to be re-pooled
  52. </summary>
  53. </member>
  54. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason.EnoughFree">
  55. <summary>
  56. There are enough free bytes in the pool
  57. </summary>
  58. </member>
  59. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamCreated(System.Guid,System.String,System.Int32)">
  60. <summary>
  61. Logged when a stream object is created.
  62. </summary>
  63. <param name="guid">A unique ID for this stream.</param>
  64. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  65. <param name="requestedSize">Requested size of the stream</param>
  66. </member>
  67. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDisposed(System.Guid,System.String)">
  68. <summary>
  69. Logged when the stream is disposed
  70. </summary>
  71. <param name="guid">A unique ID for this stream.</param>
  72. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  73. </member>
  74. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDoubleDispose(System.Guid,System.String,System.String,System.String,System.String)">
  75. <summary>
  76. Logged when the stream is disposed for the second time.
  77. </summary>
  78. <param name="guid">A unique ID for this stream.</param>
  79. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  80. <param name="allocationStack">Call stack of initial allocation.</param>
  81. <param name="disposeStack1">Call stack of the first dispose.</param>
  82. <param name="disposeStack2">Call stack of the second dispose.</param>
  83. <remarks>Note: Stacks will only be populated if RecyclableMemoryStreamManager.GenerateCallStacks is true.</remarks>
  84. </member>
  85. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamFinalized(System.Guid,System.String,System.String)">
  86. <summary>
  87. Logged when a stream is finalized.
  88. </summary>
  89. <param name="guid">A unique ID for this stream.</param>
  90. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  91. <param name="allocationStack">Call stack of initial allocation.</param>
  92. <remarks>Note: Stacks will only be populated if RecyclableMemoryStreamManager.GenerateCallStacks is true.</remarks>
  93. </member>
  94. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamToArray(System.Guid,System.String,System.String,System.Int32)">
  95. <summary>
  96. Logged when ToArray is called on a stream.
  97. </summary>
  98. <param name="guid">A unique ID for this stream.</param>
  99. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  100. <param name="stack">Call stack of the ToArray call.</param>
  101. <param name="size">Length of stream</param>
  102. <remarks>Note: Stacks will only be populated if RecyclableMemoryStreamManager.GenerateCallStacks is true.</remarks>
  103. </member>
  104. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamManagerInitialized(System.Int32,System.Int32,System.Int32)">
  105. <summary>
  106. Logged when the RecyclableMemoryStreamManager is initialized.
  107. </summary>
  108. <param name="blockSize">Size of blocks, in bytes.</param>
  109. <param name="largeBufferMultiple">Size of the large buffer multiple, in bytes.</param>
  110. <param name="maximumBufferSize">Maximum buffer size, in bytes.</param>
  111. </member>
  112. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamNewBlockCreated(System.Int64)">
  113. <summary>
  114. Logged when a new block is created.
  115. </summary>
  116. <param name="smallPoolInUseBytes">Number of bytes in the small pool currently in use.</param>
  117. </member>
  118. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamNewLargeBufferCreated(System.Int32,System.Int64)">
  119. <summary>
  120. Logged when a new large buffer is created.
  121. </summary>
  122. <param name="requiredSize">Requested size</param>
  123. <param name="largePoolInUseBytes">Number of bytes in the large pool in use.</param>
  124. </member>
  125. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamNonPooledLargeBufferCreated(System.Int32,System.String,System.String)">
  126. <summary>
  127. Logged when a buffer is created that is too large to pool.
  128. </summary>
  129. <param name="requiredSize">Size requested by the caller</param>
  130. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  131. <param name="allocationStack">Call stack of the requested stream.</param>
  132. <remarks>Note: Stacks will only be populated if RecyclableMemoryStreamManager.GenerateCallStacks is true.</remarks>
  133. </member>
  134. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardBuffer(Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamBufferType,System.String,Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamDiscardReason)">
  135. <summary>
  136. Logged when a buffer is discarded (not put back in the pool, but given to GC to clean up).
  137. </summary>
  138. <param name="bufferType">Type of the buffer being discarded.</param>
  139. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  140. <param name="reason">Reason for the discard.</param>
  141. </member>
  142. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.Events.MemoryStreamOverCapacity(System.Int32,System.Int64,System.String,System.String)">
  143. <summary>
  144. Logged when a stream grows beyond the maximum capacity.
  145. </summary>
  146. <param name="requestedCapacity">The requested capacity.</param>
  147. <param name="maxCapacity">Maximum capacity, as configured by RecyclableMemoryStreamManager.</param>
  148. <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
  149. <param name="allocationStack">Call stack for the capacity request.</param>
  150. <remarks>Note: Stacks will only be populated if RecyclableMemoryStreamManager.GenerateCallStacks is true.</remarks>
  151. </member>
  152. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.EventHandler">
  153. <summary>
  154. Generic delegate for handling events without any arguments.
  155. </summary>
  156. </member>
  157. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.LargeBufferDiscardedEventHandler">
  158. <summary>
  159. Delegate for handling large buffer discard reports.
  160. </summary>
  161. <param name="reason">Reason the buffer was discarded.</param>
  162. </member>
  163. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.StreamLengthReportHandler">
  164. <summary>
  165. Delegate for handling reports of stream size when streams are allocated
  166. </summary>
  167. <param name="bytes">Bytes allocated.</param>
  168. </member>
  169. <member name="T:Microsoft.IO.RecyclableMemoryStreamManager.UsageReportEventHandler">
  170. <summary>
  171. Delegate for handling periodic reporting of memory use statistics.
  172. </summary>
  173. <param name="smallPoolInUseBytes">Bytes currently in use in the small pool.</param>
  174. <param name="smallPoolFreeBytes">Bytes currently free in the small pool.</param>
  175. <param name="largePoolInUseBytes">Bytes currently in use in the large pool.</param>
  176. <param name="largePoolFreeBytes">Bytes currently free in the large pool.</param>
  177. </member>
  178. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.DefaultBlockSize">
  179. <summary>
  180. Default block size, in bytes
  181. </summary>
  182. </member>
  183. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.DefaultLargeBufferMultiple">
  184. <summary>
  185. Default large buffer multiple, in bytes
  186. </summary>
  187. </member>
  188. <member name="F:Microsoft.IO.RecyclableMemoryStreamManager.DefaultMaximumBufferSize">
  189. <summary>
  190. Default maximum buffer size, in bytes
  191. </summary>
  192. </member>
  193. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.#ctor">
  194. <summary>
  195. Initializes the memory manager with the default block/buffer specifications.
  196. </summary>
  197. </member>
  198. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.#ctor(System.Int32,System.Int32,System.Int32)">
  199. <summary>
  200. Initializes the memory manager with the given block requiredSize.
  201. </summary>
  202. <param name="blockSize">Size of each block that is pooled. Must be > 0.</param>
  203. <param name="largeBufferMultiple">Each large buffer will be a multiple of this value.</param>
  204. <param name="maximumBufferSize">Buffers larger than this are not pooled</param>
  205. <exception cref="T:System.ArgumentOutOfRangeException">blockSize is not a positive number, or largeBufferMultiple is not a positive number, or maximumBufferSize is less than blockSize.</exception>
  206. <exception cref="T:System.ArgumentException">maximumBufferSize is not a multiple of largeBufferMultiple</exception>
  207. </member>
  208. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.#ctor(System.Int32,System.Int32,System.Int32,System.Boolean)">
  209. <summary>
  210. Initializes the memory manager with the given block requiredSize.
  211. </summary>
  212. <param name="blockSize">Size of each block that is pooled. Must be > 0.</param>
  213. <param name="largeBufferMultiple">Each large buffer will be a multiple/exponential of this value.</param>
  214. <param name="maximumBufferSize">Buffers larger than this are not pooled</param>
  215. <param name="useExponentialLargeBuffer">Switch to exponential large buffer allocation strategy</param>
  216. <exception cref="T:System.ArgumentOutOfRangeException">blockSize is not a positive number, or largeBufferMultiple is not a positive number, or maximumBufferSize is less than blockSize.</exception>
  217. <exception cref="T:System.ArgumentException">maximumBufferSize is not a multiple/exponential of largeBufferMultiple</exception>
  218. </member>
  219. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.BlockSize">
  220. <summary>
  221. The size of each block. It must be set at creation and cannot be changed.
  222. </summary>
  223. </member>
  224. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.LargeBufferMultiple">
  225. <summary>
  226. All buffers are multiples/exponentials of this number. It must be set at creation and cannot be changed.
  227. </summary>
  228. </member>
  229. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.UseMultipleLargeBuffer">
  230. <summary>
  231. Use multiple large buffer allocation strategy. It must be set at creation and cannot be changed.
  232. </summary>
  233. </member>
  234. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.UseExponentialLargeBuffer">
  235. <summary>
  236. Use exponential large buffer allocation strategy. It must be set at creation and cannot be changed.
  237. </summary>
  238. </member>
  239. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.MaximumBufferSize">
  240. <summary>
  241. Gets the maximum buffer size.
  242. </summary>
  243. <remarks>Any buffer that is returned to the pool that is larger than this will be
  244. discarded and garbage collected.</remarks>
  245. </member>
  246. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.SmallPoolFreeSize">
  247. <summary>
  248. Number of bytes in small pool not currently in use
  249. </summary>
  250. </member>
  251. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.SmallPoolInUseSize">
  252. <summary>
  253. Number of bytes currently in use by stream from the small pool
  254. </summary>
  255. </member>
  256. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.LargePoolFreeSize">
  257. <summary>
  258. Number of bytes in large pool not currently in use
  259. </summary>
  260. </member>
  261. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.LargePoolInUseSize">
  262. <summary>
  263. Number of bytes currently in use by streams from the large pool
  264. </summary>
  265. </member>
  266. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.SmallBlocksFree">
  267. <summary>
  268. How many blocks are in the small pool
  269. </summary>
  270. </member>
  271. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.LargeBuffersFree">
  272. <summary>
  273. How many buffers are in the large pool
  274. </summary>
  275. </member>
  276. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.MaximumFreeSmallPoolBytes">
  277. <summary>
  278. How many bytes of small free blocks to allow before we start dropping
  279. those returned to us.
  280. </summary>
  281. </member>
  282. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.MaximumFreeLargePoolBytes">
  283. <summary>
  284. How many bytes of large free buffers to allow before we start dropping
  285. those returned to us.
  286. </summary>
  287. </member>
  288. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.MaximumStreamCapacity">
  289. <summary>
  290. Maximum stream capacity in bytes. Attempts to set a larger capacity will
  291. result in an exception.
  292. </summary>
  293. <remarks>A value of 0 indicates no limit.</remarks>
  294. </member>
  295. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.GenerateCallStacks">
  296. <summary>
  297. Whether to save callstacks for stream allocations. This can help in debugging.
  298. It should NEVER be turned on generally in production.
  299. </summary>
  300. </member>
  301. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.AggressiveBufferReturn">
  302. <summary>
  303. Whether dirty buffers can be immediately returned to the buffer pool. E.g. when GetBuffer() is called on
  304. a stream and creates a single large buffer, if this setting is enabled, the other blocks will be returned
  305. to the buffer pool immediately.
  306. Note when enabling this setting that the user is responsible for ensuring that any buffer previously
  307. retrieved from a stream which is subsequently modified is not used after modification (as it may no longer
  308. be valid).
  309. </summary>
  310. </member>
  311. <member name="P:Microsoft.IO.RecyclableMemoryStreamManager.ThrowExceptionOnToArray">
  312. <summary>
  313. Causes an exception to be thrown if ToArray is ever called.
  314. </summary>
  315. <remarks>Calling ToArray defeats the purpose of a pooled buffer. Use this property to discover code that is calling ToArray. If this is
  316. set and stream.ToArray() is called, a NotSupportedException will be thrown.</remarks>
  317. </member>
  318. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetBlock">
  319. <summary>
  320. Removes and returns a single block from the pool.
  321. </summary>
  322. <returns>A byte[] array</returns>
  323. </member>
  324. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetLargeBuffer(System.Int32,System.String)">
  325. <summary>
  326. Returns a buffer of arbitrary size from the large buffer pool. This buffer
  327. will be at least the requiredSize and always be a multiple/exponential of largeBufferMultiple.
  328. </summary>
  329. <param name="requiredSize">The minimum length of the buffer</param>
  330. <param name="tag">The tag of the stream returning this buffer, for logging if necessary.</param>
  331. <returns>A buffer of at least the required size.</returns>
  332. </member>
  333. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.ReturnLargeBuffer(System.Byte[],System.String)">
  334. <summary>
  335. Returns the buffer to the large pool
  336. </summary>
  337. <param name="buffer">The buffer to return.</param>
  338. <param name="tag">The tag of the stream returning this buffer, for logging if necessary.</param>
  339. <exception cref="T:System.ArgumentNullException">buffer is null</exception>
  340. <exception cref="T:System.ArgumentException">buffer.Length is not a multiple/exponential of LargeBufferMultiple (it did not originate from this pool)</exception>
  341. </member>
  342. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.ReturnBlocks(System.Collections.Generic.ICollection{System.Byte[]},System.String)">
  343. <summary>
  344. Returns the blocks to the pool
  345. </summary>
  346. <param name="blocks">Collection of blocks to return to the pool</param>
  347. <param name="tag">The tag of the stream returning these blocks, for logging if necessary.</param>
  348. <exception cref="T:System.ArgumentNullException">blocks is null</exception>
  349. <exception cref="T:System.ArgumentException">blocks contains buffers that are the wrong size (or null) for this memory manager</exception>
  350. </member>
  351. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream">
  352. <summary>
  353. Retrieve a new MemoryStream object with no tag and a default initial capacity.
  354. </summary>
  355. <returns>A MemoryStream.</returns>
  356. </member>
  357. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Guid)">
  358. <summary>
  359. Retrieve a new MemoryStream object with no tag and a default initial capacity.
  360. </summary>
  361. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  362. <returns>A MemoryStream.</returns>
  363. </member>
  364. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.String)">
  365. <summary>
  366. Retrieve a new MemoryStream object with the given tag and a default initial capacity.
  367. </summary>
  368. <param name="tag">A tag which can be used to track the source of the stream.</param>
  369. <returns>A MemoryStream.</returns>
  370. </member>
  371. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Guid,System.String)">
  372. <summary>
  373. Retrieve a new MemoryStream object with the given tag and a default initial capacity.
  374. </summary>
  375. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  376. <param name="tag">A tag which can be used to track the source of the stream.</param>
  377. <returns>A MemoryStream.</returns>
  378. </member>
  379. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.String,System.Int32)">
  380. <summary>
  381. Retrieve a new MemoryStream object with the given tag and at least the given capacity.
  382. </summary>
  383. <param name="tag">A tag which can be used to track the source of the stream.</param>
  384. <param name="requiredSize">The minimum desired capacity for the stream.</param>
  385. <returns>A MemoryStream.</returns>
  386. </member>
  387. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Guid,System.String,System.Int32)">
  388. <summary>
  389. Retrieve a new MemoryStream object with the given tag and at least the given capacity.
  390. </summary>
  391. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  392. <param name="tag">A tag which can be used to track the source of the stream.</param>
  393. <param name="requiredSize">The minimum desired capacity for the stream.</param>
  394. <returns>A MemoryStream.</returns>
  395. </member>
  396. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Guid,System.String,System.Int32,System.Boolean)">
  397. <summary>
  398. Retrieve a new MemoryStream object with the given tag and at least the given capacity, possibly using
  399. a single contiguous underlying buffer.
  400. </summary>
  401. <remarks>Retrieving a MemoryStream which provides a single contiguous buffer can be useful in situations
  402. where the initial size is known and it is desirable to avoid copying data between the smaller underlying
  403. buffers to a single large one. This is most helpful when you know that you will always call GetBuffer
  404. on the underlying stream.</remarks>
  405. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  406. <param name="tag">A tag which can be used to track the source of the stream.</param>
  407. <param name="requiredSize">The minimum desired capacity for the stream.</param>
  408. <param name="asContiguousBuffer">Whether to attempt to use a single contiguous buffer.</param>
  409. <returns>A MemoryStream.</returns>
  410. </member>
  411. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.String,System.Int32,System.Boolean)">
  412. <summary>
  413. Retrieve a new MemoryStream object with the given tag and at least the given capacity, possibly using
  414. a single contiguous underlying buffer.
  415. </summary>
  416. <remarks>Retrieving a MemoryStream which provides a single contiguous buffer can be useful in situations
  417. where the initial size is known and it is desirable to avoid copying data between the smaller underlying
  418. buffers to a single large one. This is most helpful when you know that you will always call GetBuffer
  419. on the underlying stream.</remarks>
  420. <param name="tag">A tag which can be used to track the source of the stream.</param>
  421. <param name="requiredSize">The minimum desired capacity for the stream.</param>
  422. <param name="asContiguousBuffer">Whether to attempt to use a single contiguous buffer.</param>
  423. <returns>A MemoryStream.</returns>
  424. </member>
  425. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Guid,System.String,System.Byte[],System.Int32,System.Int32)">
  426. <summary>
  427. Retrieve a new MemoryStream object with the given tag and with contents copied from the provided
  428. buffer. The provided buffer is not wrapped or used after construction.
  429. </summary>
  430. <remarks>The new stream's position is set to the beginning of the stream when returned.</remarks>
  431. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  432. <param name="tag">A tag which can be used to track the source of the stream.</param>
  433. <param name="buffer">The byte buffer to copy data from.</param>
  434. <param name="offset">The offset from the start of the buffer to copy from.</param>
  435. <param name="count">The number of bytes to copy from the buffer.</param>
  436. <returns>A MemoryStream.</returns>
  437. </member>
  438. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Byte[])">
  439. <summary>
  440. Retrieve a new MemoryStream object with the contents copied from the provided
  441. buffer. The provided buffer is not wrapped or used after construction.
  442. </summary>
  443. <remarks>The new stream's position is set to the beginning of the stream when returned.</remarks>
  444. <param name="buffer">The byte buffer to copy data from.</param>
  445. <returns>A MemoryStream.</returns>
  446. </member>
  447. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.String,System.Byte[],System.Int32,System.Int32)">
  448. <summary>
  449. Retrieve a new MemoryStream object with the given tag and with contents copied from the provided
  450. buffer. The provided buffer is not wrapped or used after construction.
  451. </summary>
  452. <remarks>The new stream's position is set to the beginning of the stream when returned.</remarks>
  453. <param name="tag">A tag which can be used to track the source of the stream.</param>
  454. <param name="buffer">The byte buffer to copy data from.</param>
  455. <param name="offset">The offset from the start of the buffer to copy from.</param>
  456. <param name="count">The number of bytes to copy from the buffer.</param>
  457. <returns>A MemoryStream.</returns>
  458. </member>
  459. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Guid,System.String,System.Memory{System.Byte})">
  460. <summary>
  461. Retrieve a new MemoryStream object with the given tag and with contents copied from the provided
  462. buffer. The provided buffer is not wrapped or used after construction.
  463. </summary>
  464. <remarks>The new stream's position is set to the beginning of the stream when returned.</remarks>
  465. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  466. <param name="tag">A tag which can be used to track the source of the stream.</param>
  467. <param name="buffer">The byte buffer to copy data from.</param>
  468. <returns>A MemoryStream.</returns>
  469. </member>
  470. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.Memory{System.Byte})">
  471. <summary>
  472. Retrieve a new MemoryStream object with the contents copied from the provided
  473. buffer. The provided buffer is not wrapped or used after construction.
  474. </summary>
  475. <remarks>The new stream's position is set to the beginning of the stream when returned.</remarks>
  476. <param name="buffer">The byte buffer to copy data from.</param>
  477. <returns>A MemoryStream.</returns>
  478. </member>
  479. <member name="M:Microsoft.IO.RecyclableMemoryStreamManager.GetStream(System.String,System.Memory{System.Byte})">
  480. <summary>
  481. Retrieve a new MemoryStream object with the given tag and with contents copied from the provided
  482. buffer. The provided buffer is not wrapped or used after construction.
  483. </summary>
  484. <remarks>The new stream's position is set to the beginning of the stream when returned.</remarks>
  485. <param name="tag">A tag which can be used to track the source of the stream.</param>
  486. <param name="buffer">The byte buffer to copy data from.</param>
  487. <returns>A MemoryStream.</returns>
  488. </member>
  489. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.BlockCreated">
  490. <summary>
  491. Triggered when a new block is created.
  492. </summary>
  493. </member>
  494. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.BlockDiscarded">
  495. <summary>
  496. Triggered when a new block is created.
  497. </summary>
  498. </member>
  499. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.LargeBufferCreated">
  500. <summary>
  501. Triggered when a new large buffer is created.
  502. </summary>
  503. </member>
  504. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.StreamCreated">
  505. <summary>
  506. Triggered when a new stream is created.
  507. </summary>
  508. </member>
  509. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.StreamDisposed">
  510. <summary>
  511. Triggered when a stream is disposed.
  512. </summary>
  513. </member>
  514. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.StreamFinalized">
  515. <summary>
  516. Triggered when a stream is finalized.
  517. </summary>
  518. </member>
  519. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.StreamLength">
  520. <summary>
  521. Triggered when a stream is finalized.
  522. </summary>
  523. </member>
  524. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.StreamConvertedToArray">
  525. <summary>
  526. Triggered when a user converts a stream to array.
  527. </summary>
  528. </member>
  529. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.LargeBufferDiscarded">
  530. <summary>
  531. Triggered when a large buffer is discarded, along with the reason for the discard.
  532. </summary>
  533. </member>
  534. <member name="E:Microsoft.IO.RecyclableMemoryStreamManager.UsageReport">
  535. <summary>
  536. Periodically triggered to report usage statistics.
  537. </summary>
  538. </member>
  539. <member name="T:Microsoft.IO.RecyclableMemoryStream">
  540. <summary>
  541. MemoryStream implementation that deals with pooling and managing memory streams which use potentially large
  542. buffers.
  543. </summary>
  544. <remarks>
  545. This class works in tandem with the RecyclableMemoryStreamManager to supply MemoryStream
  546. objects to callers, while avoiding these specific problems:
  547. 1. LOH allocations - since all large buffers are pooled, they will never incur a Gen2 GC
  548. 2. Memory waste - A standard memory stream doubles its size when it runs out of room. This
  549. leads to continual memory growth as each stream approaches the maximum allowed size.
  550. 3. Memory copying - Each time a MemoryStream grows, all the bytes are copied into new buffers.
  551. This implementation only copies the bytes when GetBuffer is called.
  552. 4. Memory fragmentation - By using homogeneous buffer sizes, it ensures that blocks of memory
  553. can be easily reused.
  554. The stream is implemented on top of a series of uniformly-sized blocks. As the stream's length grows,
  555. additional blocks are retrieved from the memory manager. It is these blocks that are pooled, not the stream
  556. object itself.
  557. The biggest wrinkle in this implementation is when GetBuffer() is called. This requires a single
  558. contiguous buffer. If only a single block is in use, then that block is returned. If multiple blocks
  559. are in use, we retrieve a larger buffer from the memory manager. These large buffers are also pooled,
  560. split by size--they are multiples/exponentials of a chunk size (1 MB by default).
  561. Once a large buffer is assigned to the stream the small blocks are NEVER again used for this stream. All operations take place on the
  562. large buffer. The large buffer can be replaced by a larger buffer from the pool as needed. All blocks and large buffers
  563. are maintained in the stream until the stream is disposed (unless AggressiveBufferReturn is enabled in the stream manager).
  564. </remarks>
  565. </member>
  566. <member name="F:Microsoft.IO.RecyclableMemoryStream.blocks">
  567. <summary>
  568. All of these blocks must be the same size
  569. </summary>
  570. </member>
  571. <member name="F:Microsoft.IO.RecyclableMemoryStream.dirtyBuffers">
  572. <summary>
  573. This list is used to store buffers once they're replaced by something larger.
  574. This is for the cases where you have users of this class that may hold onto the buffers longer
  575. than they should and you want to prevent race conditions which could corrupt the data.
  576. </summary>
  577. </member>
  578. <member name="F:Microsoft.IO.RecyclableMemoryStream.largeBuffer">
  579. <summary>
  580. This is only set by GetBuffer() if the necessary buffer is larger than a single block size, or on
  581. construction if the caller immediately requests a single large buffer.
  582. </summary>
  583. <remarks>If this field is non-null, it contains the concatenation of the bytes found in the individual
  584. blocks. Once it is created, this (or a larger) largeBuffer will be used for the life of the stream.
  585. </remarks>
  586. </member>
  587. <member name="P:Microsoft.IO.RecyclableMemoryStream.Id">
  588. <summary>
  589. Unique identifier for this stream across its entire lifetime
  590. </summary>
  591. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  592. </member>
  593. <member name="P:Microsoft.IO.RecyclableMemoryStream.Tag">
  594. <summary>
  595. A temporary identifier for the current usage of this stream.
  596. </summary>
  597. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  598. </member>
  599. <member name="P:Microsoft.IO.RecyclableMemoryStream.MemoryManager">
  600. <summary>
  601. Gets the memory manager being used by this stream.
  602. </summary>
  603. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  604. </member>
  605. <member name="P:Microsoft.IO.RecyclableMemoryStream.AllocationStack">
  606. <summary>
  607. Callstack of the constructor. It is only set if MemoryManager.GenerateCallStacks is true,
  608. which should only be in debugging situations.
  609. </summary>
  610. </member>
  611. <member name="P:Microsoft.IO.RecyclableMemoryStream.DisposeStack">
  612. <summary>
  613. Callstack of the Dispose call. It is only set if MemoryManager.GenerateCallStacks is true,
  614. which should only be in debugging situations.
  615. </summary>
  616. </member>
  617. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager)">
  618. <summary>
  619. Allocate a new RecyclableMemoryStream object.
  620. </summary>
  621. <param name="memoryManager">The memory manager</param>
  622. </member>
  623. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager,System.Guid)">
  624. <summary>
  625. Allocate a new RecyclableMemoryStream object.
  626. </summary>
  627. <param name="memoryManager">The memory manager</param>
  628. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  629. </member>
  630. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager,System.String)">
  631. <summary>
  632. Allocate a new RecyclableMemoryStream object
  633. </summary>
  634. <param name="memoryManager">The memory manager</param>
  635. <param name="tag">A string identifying this stream for logging and debugging purposes</param>
  636. </member>
  637. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager,System.Guid,System.String)">
  638. <summary>
  639. Allocate a new RecyclableMemoryStream object
  640. </summary>
  641. <param name="memoryManager">The memory manager</param>
  642. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  643. <param name="tag">A string identifying this stream for logging and debugging purposes</param>
  644. </member>
  645. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager,System.String,System.Int32)">
  646. <summary>
  647. Allocate a new RecyclableMemoryStream object
  648. </summary>
  649. <param name="memoryManager">The memory manager</param>
  650. <param name="tag">A string identifying this stream for logging and debugging purposes</param>
  651. <param name="requestedSize">The initial requested size to prevent future allocations</param>
  652. </member>
  653. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager,System.Guid,System.String,System.Int32)">
  654. <summary>
  655. Allocate a new RecyclableMemoryStream object
  656. </summary>
  657. <param name="memoryManager">The memory manager</param>
  658. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  659. <param name="tag">A string identifying this stream for logging and debugging purposes</param>
  660. <param name="requestedSize">The initial requested size to prevent future allocations</param>
  661. </member>
  662. <member name="M:Microsoft.IO.RecyclableMemoryStream.#ctor(Microsoft.IO.RecyclableMemoryStreamManager,System.Guid,System.String,System.Int32,System.Byte[])">
  663. <summary>
  664. Allocate a new RecyclableMemoryStream object
  665. </summary>
  666. <param name="memoryManager">The memory manager</param>
  667. <param name="id">A unique identifier which can be used to trace usages of the stream.</param>
  668. <param name="tag">A string identifying this stream for logging and debugging purposes</param>
  669. <param name="requestedSize">The initial requested size to prevent future allocations</param>
  670. <param name="initialLargeBuffer">An initial buffer to use. This buffer will be owned by the stream and returned to the memory manager upon Dispose.</param>
  671. </member>
  672. <member name="M:Microsoft.IO.RecyclableMemoryStream.Finalize">
  673. <summary>
  674. The finalizer will be called when a stream is not disposed properly.
  675. </summary>
  676. <remarks>Failing to dispose indicates a bug in the code using streams. Care should be taken to properly account for stream lifetime.</remarks>
  677. </member>
  678. <member name="M:Microsoft.IO.RecyclableMemoryStream.Dispose(System.Boolean)">
  679. <summary>
  680. Returns the memory used by this stream back to the pool.
  681. </summary>
  682. <param name="disposing">Whether we're disposing (true), or being called by the finalizer (false)</param>
  683. </member>
  684. <member name="M:Microsoft.IO.RecyclableMemoryStream.Close">
  685. <summary>
  686. Equivalent to Dispose
  687. </summary>
  688. </member>
  689. <member name="P:Microsoft.IO.RecyclableMemoryStream.Capacity">
  690. <summary>
  691. Gets or sets the capacity
  692. </summary>
  693. <remarks>Capacity is always in multiples of the memory manager's block size, unless
  694. the large buffer is in use. Capacity never decreases during a stream's lifetime.
  695. Explicitly setting the capacity to a lower value than the current value will have no effect.
  696. This is because the buffers are all pooled by chunks and there's little reason to
  697. allow stream truncation.
  698. Writing past the current capacity will cause Capacity to automatically increase, until MaximumStreamCapacity is reached.
  699. </remarks>
  700. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  701. </member>
  702. <member name="P:Microsoft.IO.RecyclableMemoryStream.Length">
  703. <summary>
  704. Gets the number of bytes written to this stream.
  705. </summary>
  706. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  707. </member>
  708. <member name="P:Microsoft.IO.RecyclableMemoryStream.Position">
  709. <summary>
  710. Gets the current position in the stream
  711. </summary>
  712. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  713. </member>
  714. <member name="P:Microsoft.IO.RecyclableMemoryStream.CanRead">
  715. <summary>
  716. Whether the stream can currently read
  717. </summary>
  718. </member>
  719. <member name="P:Microsoft.IO.RecyclableMemoryStream.CanSeek">
  720. <summary>
  721. Whether the stream can currently seek
  722. </summary>
  723. </member>
  724. <member name="P:Microsoft.IO.RecyclableMemoryStream.CanTimeout">
  725. <summary>
  726. Always false
  727. </summary>
  728. </member>
  729. <member name="P:Microsoft.IO.RecyclableMemoryStream.CanWrite">
  730. <summary>
  731. Whether the stream can currently write
  732. </summary>
  733. </member>
  734. <member name="M:Microsoft.IO.RecyclableMemoryStream.GetBuffer">
  735. <summary>
  736. Returns a single buffer containing the contents of the stream.
  737. The buffer may be longer than the stream length.
  738. </summary>
  739. <returns>A byte[] buffer</returns>
  740. <remarks>IMPORTANT: Doing a Write() after calling GetBuffer() invalidates the buffer. The old buffer is held onto
  741. until Dispose is called, but the next time GetBuffer() is called, a new buffer from the pool will be required.</remarks>
  742. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  743. </member>
  744. <member name="M:Microsoft.IO.RecyclableMemoryStream.CopyToAsync(System.IO.Stream,System.Int32,System.Threading.CancellationToken)">
  745. <summary>Asynchronously reads all the bytes from the current position in this stream and writes them to another stream.</summary>
  746. <param name="destination">The stream to which the contents of the current stream will be copied.</param>
  747. <param name="bufferSize">This parameter is ignored.</param>
  748. <param name="cancellationToken">The token to monitor for cancellation requests.</param>
  749. <returns>A task that represents the asynchronous copy operation.</returns>
  750. <exception cref="T:System.ArgumentNullException">
  751. <paramref name="destination" /> is <see langword="null" />.</exception>
  752. <exception cref="T:System.ObjectDisposedException">Either the current stream or the destination stream is disposed.</exception>
  753. <exception cref="T:System.NotSupportedException">The current stream does not support reading, or the destination stream does not support writing.</exception>
  754. </member>
  755. <member name="M:Microsoft.IO.RecyclableMemoryStream.GetReadOnlySequence">
  756. <summary>
  757. Returns a sequence containing the contents of the stream.
  758. </summary>
  759. <returns>A ReadOnlySequence of bytes</returns>
  760. <remarks>IMPORTANT: Doing a Write(), Dispose(), or Close() after calling GetReadOnlySequence() invalidates the sequence.</remarks>
  761. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  762. </member>
  763. <member name="M:Microsoft.IO.RecyclableMemoryStream.TryGetBuffer(System.ArraySegment{System.Byte}@)">
  764. <summary>
  765. Returns an ArraySegment that wraps a single buffer containing the contents of the stream.
  766. </summary>
  767. <param name="buffer">An ArraySegment containing a reference to the underlying bytes.</param>
  768. <returns>Always returns true.</returns>
  769. <remarks>GetBuffer has no failure modes (it always returns something, even if it's an empty buffer), therefore this method
  770. always returns a valid ArraySegment to the same buffer returned by GetBuffer.</remarks>
  771. </member>
  772. <member name="M:Microsoft.IO.RecyclableMemoryStream.ToArray">
  773. <summary>
  774. Returns a new array with a copy of the buffer's contents. You should almost certainly be using GetBuffer combined with the Length to
  775. access the bytes in this stream. Calling ToArray will destroy the benefits of pooled buffers, but it is included
  776. for the sake of completeness.
  777. </summary>
  778. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  779. <exception cref="T:System.NotSupportedException">The current RecyclableStreamManager object disallows ToArray calls.</exception>
  780. </member>
  781. <member name="M:Microsoft.IO.RecyclableMemoryStream.Read(System.Byte[],System.Int32,System.Int32)">
  782. <summary>
  783. Reads from the current position into the provided buffer
  784. </summary>
  785. <param name="buffer">Destination buffer</param>
  786. <param name="offset">Offset into buffer at which to start placing the read bytes.</param>
  787. <param name="count">Number of bytes to read.</param>
  788. <returns>The number of bytes read</returns>
  789. <exception cref="T:System.ArgumentNullException">buffer is null</exception>
  790. <exception cref="T:System.ArgumentOutOfRangeException">offset or count is less than 0</exception>
  791. <exception cref="T:System.ArgumentException">offset subtracted from the buffer length is less than count</exception>
  792. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  793. </member>
  794. <member name="M:Microsoft.IO.RecyclableMemoryStream.SafeRead(System.Byte[],System.Int32,System.Int32,System.Int32@)">
  795. <summary>
  796. Reads from the specified position into the provided buffer
  797. </summary>
  798. <param name="buffer">Destination buffer</param>
  799. <param name="offset">Offset into buffer at which to start placing the read bytes.</param>
  800. <param name="count">Number of bytes to read.</param>
  801. <param name="streamPosition">Position in the stream to start reading from</param>
  802. <returns>The number of bytes read</returns>
  803. <exception cref="T:System.ArgumentNullException">buffer is null</exception>
  804. <exception cref="T:System.ArgumentOutOfRangeException">offset or count is less than 0</exception>
  805. <exception cref="T:System.ArgumentException">offset subtracted from the buffer length is less than count</exception>
  806. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  807. </member>
  808. <member name="M:Microsoft.IO.RecyclableMemoryStream.Read(System.Span{System.Byte})">
  809. <summary>
  810. Reads from the current position into the provided buffer
  811. </summary>
  812. <param name="buffer">Destination buffer</param>
  813. <returns>The number of bytes read</returns>
  814. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  815. </member>
  816. <member name="M:Microsoft.IO.RecyclableMemoryStream.SafeRead(System.Span{System.Byte},System.Int32@)">
  817. <summary>
  818. Reads from the specified position into the provided buffer
  819. </summary>
  820. <param name="buffer">Destination buffer</param>
  821. <param name="streamPosition">Position in the stream to start reading from</param>
  822. <returns>The number of bytes read</returns>
  823. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  824. </member>
  825. <member name="M:Microsoft.IO.RecyclableMemoryStream.Write(System.Byte[],System.Int32,System.Int32)">
  826. <summary>
  827. Writes the buffer to the stream
  828. </summary>
  829. <param name="buffer">Source buffer</param>
  830. <param name="offset">Start position</param>
  831. <param name="count">Number of bytes to write</param>
  832. <exception cref="T:System.ArgumentNullException">buffer is null</exception>
  833. <exception cref="T:System.ArgumentOutOfRangeException">offset or count is negative</exception>
  834. <exception cref="T:System.ArgumentException">buffer.Length - offset is not less than count</exception>
  835. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  836. </member>
  837. <member name="M:Microsoft.IO.RecyclableMemoryStream.Write(System.ReadOnlySpan{System.Byte})">
  838. <summary>
  839. Writes the buffer to the stream
  840. </summary>
  841. <param name="source">Source buffer</param>
  842. <exception cref="T:System.ArgumentNullException">buffer is null</exception>
  843. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  844. </member>
  845. <member name="M:Microsoft.IO.RecyclableMemoryStream.ToString">
  846. <summary>
  847. Returns a useful string for debugging. This should not normally be called in actual production code.
  848. </summary>
  849. </member>
  850. <member name="M:Microsoft.IO.RecyclableMemoryStream.WriteByte(System.Byte)">
  851. <summary>
  852. Writes a single byte to the current position in the stream.
  853. </summary>
  854. <param name="value">byte value to write</param>
  855. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  856. </member>
  857. <member name="M:Microsoft.IO.RecyclableMemoryStream.ReadByte">
  858. <summary>
  859. Reads a single byte from the current position in the stream.
  860. </summary>
  861. <returns>The byte at the current position, or -1 if the position is at the end of the stream.</returns>
  862. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  863. </member>
  864. <member name="M:Microsoft.IO.RecyclableMemoryStream.SafeReadByte(System.Int32@)">
  865. <summary>
  866. Reads a single byte from the specified position in the stream.
  867. </summary>
  868. <param name="streamPosition">The position in the stream to read from</param>
  869. <returns>The byte at the current position, or -1 if the position is at the end of the stream.</returns>
  870. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  871. </member>
  872. <member name="M:Microsoft.IO.RecyclableMemoryStream.SetLength(System.Int64)">
  873. <summary>
  874. Sets the length of the stream
  875. </summary>
  876. <exception cref="T:System.ArgumentOutOfRangeException">value is negative or larger than MaxStreamLength</exception>
  877. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  878. </member>
  879. <member name="M:Microsoft.IO.RecyclableMemoryStream.Seek(System.Int64,System.IO.SeekOrigin)">
  880. <summary>
  881. Sets the position to the offset from the seek location
  882. </summary>
  883. <param name="offset">How many bytes to move</param>
  884. <param name="loc">From where</param>
  885. <returns>The new position</returns>
  886. <exception cref="T:System.ObjectDisposedException">Object has been disposed</exception>
  887. <exception cref="T:System.ArgumentOutOfRangeException">offset is larger than MaxStreamLength</exception>
  888. <exception cref="T:System.ArgumentException">Invalid seek origin</exception>
  889. <exception cref="T:System.IO.IOException">Attempt to set negative position</exception>
  890. </member>
  891. <member name="M:Microsoft.IO.RecyclableMemoryStream.WriteTo(System.IO.Stream)">
  892. <summary>
  893. Synchronously writes this stream's bytes to the argument stream.
  894. </summary>
  895. <param name="stream">Destination stream</param>
  896. <remarks>Important: This does a synchronous write, which may not be desired in some situations</remarks>
  897. <exception cref="T:System.ArgumentNullException">stream is null</exception>
  898. </member>
  899. <member name="M:Microsoft.IO.RecyclableMemoryStream.WriteTo(System.IO.Stream,System.Int32,System.Int32)">
  900. <summary>
  901. Synchronously writes this stream's bytes, starting at offset, for count bytes, to the argument stream.
  902. </summary>
  903. <param name="stream">Destination stream</param>
  904. <param name="offset">Offset in source</param>
  905. <param name="count">Number of bytes to write</param>
  906. <exception cref="T:System.ArgumentNullException">stream is null</exception>
  907. <exception cref="T:System.ArgumentOutOfRangeException">Offset is less than 0, or offset + count is beyond this stream's length.</exception>
  908. </member>
  909. <member name="M:Microsoft.IO.RecyclableMemoryStream.ReleaseLargeBuffer">
  910. <summary>
  911. Release the large buffer (either stores it for eventual release or returns it immediately).
  912. </summary>
  913. </member>
  914. </members>
  915. </doc>