1 /*
2  * Copyright 2013 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkStreamPriv_DEFINED
9 #define SkStreamPriv_DEFINED
10 
11 class SkData;
12 class SkStream;
13 class SkWStream;
14 
15 /**
16  *  Copy the provided stream to an SkData variable.
17  *
18  *  Note: Assumes the stream is at the beginning. If it has a length,
19  *  but is not at the beginning, this call will fail (return NULL).
20  *
21  *  @param stream SkStream to be copied into data.
22  *  @return SkData* The resulting SkData after the copy. This data
23  *      will have a ref count of one upon return and belongs to the
24  *      caller. Returns nullptr on failure.
25  */
26 SkData* SkCopyStreamToData(SkStream* stream);
27 
28 /**
29  *  Copies the input stream from the current position to the end.
30  *  Does not rewind the input stream.
31  */
32 bool SkStreamCopy(SkWStream* out, SkStream* input);
33 
34 #endif  // SkStreamPriv_DEFINED
35