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 | #include "include/core/SkRefCnt.h" |
12 | |
13 | class SkData; |
14 | class SkStream; |
15 | class SkWStream; |
16 | |
17 | /** |
18 | * Copy the provided stream to an SkData variable. |
19 | * |
20 | * Note: Assumes the stream is at the beginning. If it has a length, |
21 | * but is not at the beginning, this call will fail (return NULL). |
22 | * |
23 | * @param stream SkStream to be copied into data. |
24 | * @return The resulting SkData after the copy, nullptr on failure. |
25 | */ |
26 | sk_sp<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 | |