| 122 | } |
| 123 | |
| 124 | Status Write(const void* data, int64_t nbytes) { |
| 125 | RETURN_NOT_OK(CheckClosed()); |
| 126 | |
| 127 | // Since the data isn't owned, we have to make a copy |
| 128 | PyObject* py_data = |
| 129 | PyBytes_FromStringAndSize(reinterpret_cast<const char*>(data), nbytes); |
| 130 | PY_RETURN_IF_ERROR(StatusCode::IOError); |
| 131 | |
| 132 | PyObject* result = cpp_PyObject_CallMethod(file_.obj(), "write", "(O)", py_data); |
| 133 | Py_XDECREF(py_data); |
| 134 | Py_XDECREF(result); |
| 135 | PY_RETURN_IF_ERROR(StatusCode::IOError); |
| 136 | return Status::OK(); |
| 137 | } |
| 138 | |
| 139 | Status Write(const std::shared_ptr<Buffer>& buffer) { |
| 140 | RETURN_NOT_OK(CheckClosed()); |
nothing calls this directly
no test coverage detected