source: trunk/Include/Classes/System/IO/Stream.ab@ 468

Last change on this file since 468 was 468, checked in by イグトランス (egtra), 16 years ago

TextWriter, StreamWriterの追加。
SPrintfの浮動小数点数変換で、NaN, Infiniteの出力に対応。
PathとDirectoryInfoのCreateDirectoryで、対象が既に存在するときには例外を投げないように修正。
SimpleTestCase内で使用する一時フォルダの場所にGetTempPathで取得する版を追加(コメントアウト)。

File size: 2.2 KB
RevLine 
[271]1Namespace System
2Namespace IO
[111]3
[271]4
[112]5Class Stream
[381]6 Implements System.IDisposable
[347]7
[119]8Public 'Protected
[468]9 Sub Stream()
10 End Sub
[114]11Public
[119]12 Virtual Sub ~Stream()
[388]13 This.Dispose(False)
[119]14 End Sub
15Public
16 Abstract Function CanRead() As Boolean
17 Abstract Function CanSeek() As Boolean
[111]18
[119]19 Virtual Function CanTimeout() As Boolean
20 Return True
21 End Function
22
23 Abstract Function CanWrite() As Boolean
24 Abstract Function Length() As Int64
25 Abstract Sub Position(value As Int64)
26 Abstract Function Position() As Int64
27
28 Virtual Sub ReadTimeout(value As Long)
29 ' Throw InvalidOperationException
30 End Sub
31
32 Virtual Function ReadTimeout() As Long
33 ' Throw InvalidOperationException
34 End Function
35
36 Virtual Sub WriteTimeout(value As Long)
37 ' Throw InvalidOperationException
38 End Sub
39
40 Virtual Function WriteTimeout() As Long
41 ' Throw InvalidOperationException
42 End Function
43
[112]44Public
[347]45 Virtual Function BeginRead(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult
46 Read(buffer,offset,count)
47 End Function
48 Virtual Function BeginWrite(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult
49 Write(buffer,offset,count)
50 End Function
[432]51 Sub Close()
[388]52 Dispose(True)
[347]53 End Sub
[432]54 Sub Dispose()
[388]55 Dispose(True)
56 End Sub
[468]57 Virtual Function EndRead(ByRef asyncResult As System.IAsyncResult) As Long
58 End Function
59 Virtual Sub EndWrite(ByRef asyncResult As System.IAsyncResult)
60 End Sub
[119]61 Abstract Sub Flush()
[337]62 Abstract Function Read(buffer As *Byte, offset As Long, count As Long) As Long
[112]63
[119]64 Virtual Function ReadByte() As Long
65 Dim b As Byte
[337]66 Dim ret = Read(VarPtr(b), 0, 1)
[119]67 If ret <> 0 Then
68 Return b
69 Else
70 Return -1
71 End If
72 End Function
73
[391]74 Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Int64
[248]75 Abstract Sub SetLength(value As Int64)
[337]76 Abstract Sub Write(buffer As *Byte, offset As Long, count As Long)
[119]77 Virtual Sub WriteByte(b As Byte)
[337]78 Write(VarPtr(b), 0, 1)
[119]79 End Sub
[112]80Protected
[432]81 Virtual Sub Dispose(disposing As Boolean)
82 End Sub
83 Virtual Function CreateWaitHandle() As System.Threading.WaitHandle
84 End Function
[112]85End Class
[271]86
87
88End Namespace
89End Namespace
Note: See TracBrowser for help on using the repository browser.