michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkStreamHelpers_DEFINED michael@0: #define SkStreamHelpers_DEFINED michael@0: michael@0: class SkAutoMalloc; michael@0: class SkStream; michael@0: michael@0: /** michael@0: * Copy the provided stream to memory allocated by storage. michael@0: * Used by SkImageDecoder_libbmp and SkImageDecoder_libico. michael@0: * @param storage Allocator to hold the memory. Will be reset to be large michael@0: * enough to hold the entire stream. Upon successful return, michael@0: * storage->get() will point to data holding the SkStream's entire michael@0: * contents. michael@0: * @param stream SkStream to be copied into storage. michael@0: * @return size_t Total number of bytes in the SkStream, which is also the michael@0: * number of bytes pointed to by storage->get(). Returns 0 on failure. michael@0: */ michael@0: size_t CopyStreamToStorage(SkAutoMalloc* storage, SkStream* stream); michael@0: michael@0: #endif // SkStreamHelpers_DEFINED