| 97 | class TestBufferedOutputStream : public FileTestFixture<BufferedOutputStream> { |
| 98 | public: |
| 99 | void OpenBuffered(int64_t buffer_size = kDefaultBufferSize, bool append = false) { |
| 100 | // So that any open file is closed |
| 101 | buffered_.reset(); |
| 102 | |
| 103 | ASSERT_OK_AND_ASSIGN(auto file, FileOutputStream::Open(path_, append)); |
| 104 | fd_ = file->file_descriptor(); |
| 105 | if (append) { |
| 106 | // Workaround for ARROW-2466 ("append" flag doesn't set file pos) |
| 107 | #if defined(_MSC_VER) |
| 108 | _lseeki64(fd_, 0, SEEK_END); |
| 109 | #else |
| 110 | lseek(fd_, 0, SEEK_END); |
| 111 | #endif |
| 112 | } |
| 113 | ASSERT_OK_AND_ASSIGN(buffered_, BufferedOutputStream::Create( |
| 114 | buffer_size, default_memory_pool(), file)); |
| 115 | } |
| 116 | |
| 117 | void WriteChunkwise(const std::string& datastr, const std::valarray<int64_t>& sizes) { |
| 118 | const char* data = datastr.data(); |
nothing calls this directly
no test coverage detected