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