MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / createInputStream

Method createInputStream

ij/src/main/java/ij/io/Opener.java:1571–1587  ·  view source on GitHub ↗

Returns an InputStream for the image described by this FileInfo.

(FileInfo fi)

Source from the content-addressed store, hash-verified

1569
1570 /** Returns an InputStream for the image described by this FileInfo. */
1571 InputStream createInputStream(FileInfo fi) throws IOException, MalformedURLException {
1572 if (fi.inputStream!=null)
1573 return fi.inputStream;
1574 else if (fi.url!=null && !fi.url.equals(""))
1575 return new URL(fi.url+fi.fileName).openStream();
1576 else {
1577 File f = new File(fi.getFilePath());
1578 if (f==null || f.isDirectory())
1579 return null;
1580 else {
1581 InputStream is = new FileInputStream(f);
1582 if (fi.compression>=FileInfo.LZW || (fi.stripOffsets!=null&&fi.stripOffsets.length>1))
1583 is = new RandomAccessStream(is);
1584 return is;
1585 }
1586 }
1587 }
1588
1589 void openRGB48(ImagePlus imp) {
1590 isRGB48 = false;

Callers 1

openTiffStackMethod · 0.95

Calls 2

equalsMethod · 0.45
getFilePathMethod · 0.45

Tested by

no test coverage detected