1 | Namespace System
|
---|
2 | Namespace IO
|
---|
3 |
|
---|
4 |
|
---|
5 | Class Stream
|
---|
6 | Implements System.IDisposable
|
---|
7 |
|
---|
8 | Public 'Protected
|
---|
9 | Sub Stream()
|
---|
10 | End Sub
|
---|
11 | Public
|
---|
12 | Virtual Sub ~Stream()
|
---|
13 | This.Dispose(False)
|
---|
14 | End Sub
|
---|
15 | Public
|
---|
16 | Abstract Function CanRead() As Boolean
|
---|
17 | Abstract Function CanSeek() As Boolean
|
---|
18 |
|
---|
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 |
|
---|
44 | Public
|
---|
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
|
---|
51 | Sub Close()
|
---|
52 | Dispose(True)
|
---|
53 | End Sub
|
---|
54 | Sub Dispose()
|
---|
55 | Dispose(True)
|
---|
56 | End Sub
|
---|
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
|
---|
61 | Abstract Sub Flush()
|
---|
62 | Abstract Function Read(buffer As *Byte, offset As Long, count As Long) As Long
|
---|
63 |
|
---|
64 | Virtual Function ReadByte() As Long
|
---|
65 | Dim b As Byte
|
---|
66 | Dim ret = Read(VarPtr(b), 0, 1)
|
---|
67 | If ret <> 0 Then
|
---|
68 | Return b
|
---|
69 | Else
|
---|
70 | Return -1
|
---|
71 | End If
|
---|
72 | End Function
|
---|
73 |
|
---|
74 | Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Int64
|
---|
75 | Abstract Sub SetLength(value As Int64)
|
---|
76 | Abstract Sub Write(buffer As *Byte, offset As Long, count As Long)
|
---|
77 | Virtual Sub WriteByte(b As Byte)
|
---|
78 | Write(VarPtr(b), 0, 1)
|
---|
79 | End Sub
|
---|
80 | Protected
|
---|
81 | Virtual Sub Dispose(disposing As Boolean)
|
---|
82 | End Sub
|
---|
83 | Virtual Function CreateWaitHandle() As System.Threading.WaitHandle
|
---|
84 | End Function
|
---|
85 | End Class
|
---|
86 |
|
---|
87 |
|
---|
88 | End Namespace
|
---|
89 | End Namespace
|
---|