File indexing completed on 2025-08-28 08:26:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #pragma once
0021
0022 #include <cstdint>
0023 #include <functional>
0024 #include <memory>
0025 #include <utility>
0026
0027 #include "arrow/io/interfaces.h"
0028 #include "arrow/util/visibility.h"
0029
0030 namespace arrow {
0031 namespace io {
0032
0033 class ARROW_EXPORT TransformInputStream : public InputStream {
0034 public:
0035 using TransformFunc =
0036 std::function<Result<std::shared_ptr<Buffer>>(const std::shared_ptr<Buffer>&)>;
0037
0038 TransformInputStream(std::shared_ptr<InputStream> wrapped, TransformFunc transform);
0039 ~TransformInputStream() override;
0040
0041 Status Close() override;
0042 Status Abort() override;
0043 bool closed() const override;
0044
0045 Result<int64_t> Read(int64_t nbytes, void* out) override;
0046 Result<std::shared_ptr<Buffer>> Read(int64_t nbytes) override;
0047
0048 Result<std::shared_ptr<const KeyValueMetadata>> ReadMetadata() override;
0049 Future<std::shared_ptr<const KeyValueMetadata>> ReadMetadataAsync(
0050 const IOContext& io_context) override;
0051
0052 Result<int64_t> Tell() const override;
0053
0054 protected:
0055 struct Impl;
0056 std::unique_ptr<Impl> impl_;
0057 };
0058
0059 }
0060 }