1 //===---- llvm/Support/DataStream.h - Lazy bitcode streaming ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header defines DataStreamer, which fetches bytes of data from
11 // a stream source. It provides support for streaming (lazy reading) of
14 //===----------------------------------------------------------------------===//
17 #ifndef LLVM_SUPPORT_DATASTREAM_H
18 #define LLVM_SUPPORT_DATASTREAM_H
27 /// Fetch bytes [start-end) from the stream, and write them to the
28 /// buffer pointed to by buf. Returns the number of bytes actually written.
29 virtual size_t GetBytes(unsigned char *buf, size_t len) = 0;
31 virtual ~DataStreamer();
34 std::unique_ptr<DataStreamer> getDataFileStreamer(const std::string &Filename,
38 #endif // LLVM_SUPPORT_DATASTREAM_H_