# Discrepancy between vtkPLYReader and vtkSTLReader when streaming.

**URL:** https://discourse.vtk.org/t/discrepancy-between-vtkplyreader-and-vtkstlreader-when-streaming/16443
**Category:** Development
**Created:** [June 4, 2026, 5:09pm UTC](https://discourse.vtk.org/t/discrepancy-between-vtkplyreader-and-vtkstlreader-when-streaming/16443 "2026-06-04T17:09:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Seun](https://discourse.vtk.org/user_avatar/discourse.vtk.org/seun/32/767_2.png) [@Seun](https://discourse.vtk.org/u/Seun)
#### Post date: [June 4, 2026, 5:09pm UTC](https://discourse.vtk.org/t/discrepancy-between-vtkplyreader-and-vtkstlreader-when-streaming/16443/1 "2026-06-04T17:09:07Z")

</div>

Hi everyone,

I was wondering why there seems to be a difference in usage of `vtkMemoryResourceStream ` with both PLY & STL readers. the former requires explicit declaration of turning on the stream despite setting the buffer which isn’t the case for the latter whereby setting the buffer is sufficient.

```auto
// data is NSData (as I'm working on macOS)

vtkSmartPointer<vtkMemoryResourceStream> memoryStream = vtkSmartPointer<vtkMemoryResourceStream>::New();
memoryStream->SetBuffer([data bytes], [data length]);

// PLY
//---------------------------------------------------------
vtkSmartPointer<vtkPLYReader> reader = vtkSmartPointer<vtkPLYReader>::New();
reader->SetStream(memoryStream);
reader->ReadFromInputStreamOn(); // without this, it will fail to read
reader->Update();
polydata = reader->GetOutput();

// STL (this works) 
// + there no such API to explicitly ReadFromInputStreamOn
//---------------------------------------------------------

vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
reader->SetStream(memoryStream);
reader->Update();
polydata = reader->GetOutput();

```

why is this the case?

---

<div class="post-metadata">

### Author: ![lgivord](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lgivord/32/3543_2.png) [@lgivord](https://discourse.vtk.org/u/lgivord)
#### Post date: [June 5, 2026, 8:12am UTC](https://discourse.vtk.org/t/discrepancy-between-vtkplyreader-and-vtkstlreader-when-streaming/16443/2 "2026-06-05T08:12:47Z")

</div>

FYI @alexy.pellegrini @mwestphal

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [June 9, 2026, 12:56pm UTC](https://discourse.vtk.org/t/discrepancy-between-vtkplyreader-and-vtkstlreader-when-streaming/16443/3 "2026-06-09T12:56:10Z")

</div>

Historical reasons mostly.

When I added stream support to both, the `vtkPLYReader::ReadFromInputStreamOn` API already existed so I kept it around as deprecating it seemed not really needed.

But also this API is not really useful, so I did not add it where it did not exists at all, such as the vtkSTLReader
