change SkStreams to work with sk_sp<SkData> instead of SkData*

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333713002

Review-Url: https://codereview.chromium.org/2333713002
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index c719f48..2d9468e 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -106,7 +106,7 @@
         compressedByteStream.writeToStream(&expected);
         compressedByteStream.reset();
         expected.writeText("\nendstream");
-        sk_sp<SkData> expectedResultData2(expected.copyToData());
+        sk_sp<SkData> expectedResultData2(expected.detachAsData());
         SkString result = emit_to_string(*stream);
         #ifndef SK_PDF_LESS_COMPRESSION
         assert_eql(reporter,