xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/spdy/core/array_output_buffer.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "quiche/spdy/core/array_output_buffer.h"
6 
7 #include <cstdint>
8 
9 namespace spdy {
10 
Next(char ** data,int * size)11 void ArrayOutputBuffer::Next(char** data, int* size) {
12   *data = current_;
13   *size = capacity_ > 0 ? capacity_ : 0;
14 }
15 
AdvanceWritePtr(int64_t count)16 void ArrayOutputBuffer::AdvanceWritePtr(int64_t count) {
17   current_ += count;
18   capacity_ -= count;
19 }
20 
BytesFree() const21 uint64_t ArrayOutputBuffer::BytesFree() const { return capacity_; }
22 
23 }  // namespace spdy
24