1 | Namespace System
|
---|
2 | Namespace IO
|
---|
3 |
|
---|
4 |
|
---|
5 | Class Stream
|
---|
6 | Inherits System.IDisposable
|
---|
7 |
|
---|
8 | Public 'Protected
|
---|
9 | Sub Stream(): End Sub
|
---|
10 | Public
|
---|
11 | Virtual Sub ~Stream()
|
---|
12 | This.Close()
|
---|
13 | End Sub
|
---|
14 | Public
|
---|
15 | Abstract Function CanRead() As Boolean
|
---|
16 | Abstract Function CanSeek() As Boolean
|
---|
17 |
|
---|
18 | Virtual Function CanTimeout() As Boolean
|
---|
19 | Return True
|
---|
20 | End Function
|
---|
21 |
|
---|
22 | Abstract Function CanWrite() As Boolean
|
---|
23 | Abstract Function Length() As Int64
|
---|
24 | Abstract Sub Position(value As Int64)
|
---|
25 | Abstract Function Position() As Int64
|
---|
26 |
|
---|
27 | Virtual Sub ReadTimeout(value As Long)
|
---|
28 | ' Throw InvalidOperationException
|
---|
29 | End Sub
|
---|
30 |
|
---|
31 | Virtual Function ReadTimeout() As Long
|
---|
32 | ' Throw InvalidOperationException
|
---|
33 | End Function
|
---|
34 |
|
---|
35 | Virtual Sub WriteTimeout(value As Long)
|
---|
36 | ' Throw InvalidOperationException
|
---|
37 | End Sub
|
---|
38 |
|
---|
39 | Virtual Function WriteTimeout() As Long
|
---|
40 | ' Throw InvalidOperationException
|
---|
41 | End Function
|
---|
42 |
|
---|
43 | Public
|
---|
44 | Virtual Function BeginRead(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult
|
---|
45 | Read(buffer,offset,count)
|
---|
46 | End Function
|
---|
47 | Virtual Function BeginWrite(buffer As *Byte, offset As Long, count As Long, callback As AsyncCallback, state As Object) As System.IAsyncResult
|
---|
48 | Write(buffer,offset,count)
|
---|
49 | End Function
|
---|
50 | Virtual Sub Close()
|
---|
51 | This.Dispose()
|
---|
52 | End Sub
|
---|
53 | Virtual Function EndRead(ByRef asyncResult As System.IAsyncResult) As Long: End Function
|
---|
54 | Virtual Sub EndWrite(ByRef asyncResult As System.IAsyncResult): End Sub
|
---|
55 | Abstract Sub Flush()
|
---|
56 | Abstract Function Read(buffer As *Byte, offset As Long, count As Long) As Long
|
---|
57 |
|
---|
58 | Virtual Function ReadByte() As Long
|
---|
59 | Dim b As Byte
|
---|
60 | Dim ret = Read(VarPtr(b), 0, 1)
|
---|
61 | If ret <> 0 Then
|
---|
62 | Return b
|
---|
63 | Else
|
---|
64 | Return -1
|
---|
65 | End If
|
---|
66 | End Function
|
---|
67 |
|
---|
68 | Abstract Function Seek(offset As Int64, origin As SeekOrigin) As Long
|
---|
69 | Abstract Sub SetLength(value As Int64)
|
---|
70 | Abstract Sub Write(buffer As *Byte, offset As Long, count As Long)
|
---|
71 |
|
---|
72 | Virtual Sub WriteByte(b As Byte)
|
---|
73 | Write(VarPtr(b), 0, 1)
|
---|
74 | End Sub
|
---|
75 | Protected
|
---|
76 | Virtual Function CreateWaitHandle() As System.Threading.WaitHandle: End Function
|
---|
77 | End Class
|
---|
78 |
|
---|
79 |
|
---|
80 | End Namespace
|
---|
81 | End Namespace
|
---|