NotSupportedStreamBase.cs 1.4 KB

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