crotwell / seisFile

A library for reading and writing seismic file formats in java.
GNU Lesser General Public License v3.0
28 stars 20 forks source link

readData does not close miniseed files #16

Closed andreabono closed 4 years ago

andreabono commented 4 years ago

Il seems like the edu.sc.seis.seisFile readData routine does not close the miniseed file after creating it.

public void readData() throws SeedFormatException, IOException, SeisFileException { compiled code }

Windows locks the file and I can't delete it...
Am I wrong?

crotwell commented 4 years ago

What class are you using? There is more than one readData method in seisFIle, so need some more info to reproduce.

andreabono commented 4 years ago

class MSeedQueryClient

crotwell commented 4 years ago

MSeedQueryClient is abstract. Are you extending it?

It does not close the output as it can't know if you are finished with it or not, for example you may wish to output the result of multiple queries into the same output stream.

To close it from your class that extends MSeedQueryClient call

if (params.getDataOutputStream() != null) {
            params.getDataOutputStream().close();
}