# Reading ply data over SetInputString

**URL:** https://discourse.vtk.org/t/reading-ply-data-over-setinputstring/8305
**Category:** Support
**Created:** [April 15, 2022, 3:24pm UTC](https://discourse.vtk.org/t/reading-ply-data-over-setinputstring/8305 "2022-04-15T15:24:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![csad6517](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/c/49beb7/32.png) [@csad6517](https://discourse.vtk.org/u/csad6517)
#### Post date: [April 15, 2022, 3:24pm UTC](https://discourse.vtk.org/t/reading-ply-data-over-setinputstring/8305/1 "2022-04-15T15:24:50Z")

</div>

I am trying to stream a ply file instead of reading it from a file using `SetInputString()`. The `data` is a binary string, which looks like:

```
ply
format binary_little_endian 1.0
comment VTK generated PLY File
comment SPACE=LPS
obj_info vtkPolyData points and polygons: vtk4.0
element vertex 120
property float x
property float y
property float z
property float u
property float v
element face 120
property list uchar int vertex_indices
end_header
??B"?B??

```

If I read the same data from a file using `reader->SetFileName()`, it works as expected. But for the following case, the number of read cells are 0.

```
vtkSmartPointer<vtkPLYReader> reader = vtkSmartPointer<vtkPLYReader>::New();
reader->SetReadFromInputString(true);
reader->ReadFromInputStringOn();
reader->SetInputString(data.c_str());
reader->Update();

vtkSmartPointer<vtkPolyData> polyData = reader->GetOutput();
polyData->Modified();

std::cout << "data: " << data.c_str() <<std::endl;
std::cout << "number of cells: " << polyData->GetNumberOfCells() <<std::endl;
```
