- Timestamp:
- Aug 22, 2008, 11:57:39 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/IO/Stream.ab
r605 r609 1 1 Namespace System 2 2 Namespace IO 3 4 3 5 4 Class Stream … … 82 81 Write(VarPtr(b), 0, 1) 83 82 End Sub 83 84 Static Function Null() As Stream 85 '(Constではなく)読み取り専用にはこうするしかないはず。 86 If ActiveBasic.IsNothing(null) Then 87 null = New Detail.NullStream 88 End If 89 Null = null 90 End Function 84 91 Protected 85 92 Virtual Sub Dispose(disposing As Boolean) 86 93 End Sub 94 95 Private 96 Static null = Nothing As Stream 87 97 End Class 88 98 99 Namespace Detail 100 101 /*! 102 @brief ヌルストリーム 103 @date 2008/08/21 104 @auther Egtra 105 */ 106 Class NullStream 107 Inherits Stream 108 Public 109 Override Function CanRead() As Boolean 110 CanRead = True 111 End Function 112 113 Override Function Read(buffer As *Byte, offset As Long, count As Long) As Long 114 Read = 0 115 End Function 116 117 Override Function ReadByte() As Long 118 ReadByte = -1 119 End Function 120 121 Override Function CanWrite() As Boolean 122 CanWrite = True 123 End Function 124 125 Override Sub Write(buffer As *Byte, offset As Long, count As Long) 126 End Sub 127 128 Override Sub WriteByte(b As Byte) 129 End Sub 130 131 Override Sub Flush() 132 End Sub 133 134 Override Function CanSeek() As Boolean 135 CanSeek = True 136 End Function 137 138 Override Function Length() As QWord 139 Length = 0 140 End Function 141 142 Override Sub Position(value As QWord) 143 End Sub 144 145 Override Function Position() As QWord 146 Position = 0 147 End Function 148 149 Override Function Seek(offset As Int64, origin As SeekOrigin) As Int64 150 Seek = 0 151 End Function 152 153 Override Sub SetLength(value As QWord) 154 End Sub 155 End Class 156 157 End Namespace 89 158 90 159 End Namespace
Note:
See TracChangeset
for help on using the changeset viewer.