1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
using System; using System.IO; using System.Collections.Generic; using System.Text; namespace XeonProductions { class BinaryReaderEx: BinaryReader { bool disposeStream = true; public BinaryReaderEx(Stream input, bool disposeStream) : base(input) { this.disposeStream = disposeStream; } public BinaryReaderEx(Stream input, Encoding encoding, bool disposeStream) : base(input, encoding) { this.disposeStream = disposeStream; } public BinaryReaderEx(Stream input) : base(input) { } public BinaryReaderEx(Stream input, Encoding encoding) : base(input, encoding) { } protected override void Dispose(bool disposing) { base.Dispose(disposeStream); } public bool DisposeStream { get { return disposeStream; } set { disposeStream = value; } } } class BinaryWriterEx : BinaryWriter { bool disposeStream = true; public BinaryWriterEx(Stream input, bool disposeStream) : base(input) { this.disposeStream = disposeStream; } public BinaryWriterEx(Stream input, Encoding encoding, bool disposeStream) : base(input, encoding) { this.disposeStream = disposeStream; } public BinaryWriterEx(Stream input) : base(input) { } public BinaryWriterEx(Stream input, Encoding encoding) : base(input, encoding) { } protected override void Dispose(bool disposing) { base.Dispose(disposeStream); } public bool DisposeStream { get { return disposeStream; } set { disposeStream = value; } } } } |