30 #ifndef __BYTESTREAM_H__
31 #define __BYTESTREAM_H__
67 virtual void Append(
const char* bytes, int32_t n) = 0;
111 virtual char* GetAppendBuffer(int32_t min_capacity,
112 int32_t desired_capacity_hint,
113 char* scratch, int32_t scratch_capacity,
114 int32_t* result_capacity);
124 virtual void Flush();
167 virtual void Append(
const char* bytes, int32_t n);
183 int32_t desired_capacity_hint,
184 char* scratch, int32_t scratch_capacity,
185 int32_t* result_capacity);
209 const int32_t capacity_;
218 #if U_HAVE_STD_STRING
225 template<
typename StringClass>
226 class StringByteSink :
public ByteSink {
233 StringByteSink(StringClass* dest) : dest_(dest) { }
240 virtual void Append(
const char* data, int32_t n) { dest_->append(data, n); }
244 StringByteSink(
const StringByteSink &);
245 StringByteSink &operator=(
const StringByteSink &);
252 #endif // __BYTESTREAM_H__