NotSupportedStreamBase.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Lua.IO;
  2. namespace Lua.Tests.Helpers
  3. {
  4. public class NotSupportedStreamBase : ILuaIOStream
  5. {
  6. public virtual void Dispose()
  7. {
  8. }
  9. public virtual LuaFileOpenMode Mode => throw IOThrowHelpers.GetNotSupportedException();
  10. public LuaFileContentType ContentType=> throw IOThrowHelpers.GetNotSupportedException();
  11. public virtual ValueTask<string?> ReadLineAsync(CancellationToken cancellationToken)
  12. {
  13. throw IOThrowHelpers.GetNotSupportedException();
  14. }
  15. public virtual ValueTask<LuaFileContent> ReadAllAsync(CancellationToken cancellationToken)
  16. {
  17. throw IOThrowHelpers.GetNotSupportedException();
  18. }
  19. public virtual ValueTask<string?> ReadStringAsync(int count, CancellationToken cancellationToken)
  20. {
  21. throw IOThrowHelpers.GetNotSupportedException();
  22. }
  23. public virtual ValueTask WriteAsync(LuaFileContent content, CancellationToken cancellationToken)
  24. {
  25. throw IOThrowHelpers.GetNotSupportedException();
  26. }
  27. public virtual ValueTask FlushAsync(CancellationToken cancellationToken)
  28. {
  29. throw IOThrowHelpers.GetNotSupportedException();
  30. }
  31. public virtual void SetVBuf(LuaFileBufferingMode mode, int size)
  32. {
  33. throw IOThrowHelpers.GetNotSupportedException();
  34. }
  35. public virtual long Seek(long offset, SeekOrigin origin)
  36. {
  37. throw IOThrowHelpers.GetNotSupportedException();
  38. }
  39. }
  40. }