Class File
Private fileName As String
Public Function Read(bytes As Integer) As Byte()
If Not ReadFile(handle, bytes) Then
Throw NewFileIOException()
End If
End Function 'Read
Function NewFileIOException() As FileException
Dim description As String = __unknown ' Build localized string, including fileName.
Return New FileException(description) '
End Function 'NewFileIOException
End Class 'File
class File {
string fileName;
public byte[] Read(int bytes) {
if (!ReadFile(handle, bytes))
throw NewFileIOException();
}
FileException NewFileIOException() {
string description = // Build localized string, including fileName.
return new FileException(description);
}
}