Would it be considered bad practice to pass a stream/reader to a container class when reading data from a file, as opposed to reading the data within the calling method, then passing the values as parameters?

**For example**

```
public DummyClass(DataInputStream input) throws IOException {
    this.valueA = input.readInt();
    this.valueB = input.readInt();
}

```

**Opposed to**

```
public DummyClass(int a, int b) {
    this.valueA = a;
    this.valueB = b;
}

```