- explicit FileOutputStream(FILE *file);
- virtual ~FileOutputStream();
-
-protected:
- virtual void write_internal(const void *data, size_t len);
-
-private:
- FILE *f;
-};
-
-/* An OutputStream which is simply sends writes to another OutputStream, but
- * does provide separate tracking of bytes written. */
-class WrapperOutputStream : public OutputStream {
-public:
- explicit WrapperOutputStream(OutputStream &o);
- virtual ~WrapperOutputStream() { }
-
-protected:
- virtual void write_internal(const void *data, size_t len);
-
-private:
- OutputStream ℜ
-};
-
-/* Simple wrappers that encode integers using a StringOutputStream and return
- * the encoded result. */
-std::string encode_u16(uint16_t val);
-std::string encode_u32(uint32_t val);
-std::string encode_u64(uint64_t val);
-
-struct uuid {
- uint8_t bytes[16];
-};
-
-/* A class which is used to pack multiple objects into a single segment, with a
- * lookup table to quickly locate each object. Call new_object() to get an
- * OutputStream to which a new object may be written, and optionally
- * finish_object() when finished writing the current object. Only one object
- * may be written to a segment at a time; if multiple objects must be written
- * concurrently, they must be to different segments. */
-class SegmentWriter {
-public:
- SegmentWriter(OutputStream *output, struct uuid u);
- ~SegmentWriter();
-
- struct uuid get_uuid() const { return id; }