summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_stream.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-06-27 16:13:17 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-27 20:59:17 +0000
commitd39443e8a5ae8e189e272accc23c5e66d9f0bd8d (patch)
tree1935b54935b6ab0983c186ea3fd1c86a6103833e /core/fpdfapi/parser/cpdf_stream.cpp
parent6fac27d038697806aacdf1960e5a99eceda5ce31 (diff)
downloadpdfium-d39443e8a5ae8e189e272accc23c5e66d9f0bd8d.tar.xz
Add overload for CPDF_Stream.SetData() that takes an ostringstream.
Bug: pdfium:731 Change-Id: Ie65bafc644cff076b0d7aadcc5d0b0e33e2c199b Reviewed-on: https://pdfium-review.googlesource.com/7035 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_stream.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_stream.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp
index 69a87e6d2e..ec12ac5080 100644
--- a/core/fpdfapi/parser/cpdf_stream.cpp
+++ b/core/fpdfapi/parser/cpdf_stream.cpp
@@ -110,6 +110,11 @@ void CPDF_Stream::SetData(const uint8_t* pData, uint32_t size) {
m_pDict->RemoveFor("DecodeParms");
}
+void CPDF_Stream::SetData(std::ostringstream* stream) {
+ SetData(reinterpret_cast<const uint8_t*>(stream->str().c_str()),
+ stream->tellp());
+}
+
bool CPDF_Stream::ReadRawData(FX_FILESIZE offset,
uint8_t* buf,
uint32_t size) const {