/** * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) */ @Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); if (wlz != null) { buf = wlz.readBytes(no, buf, x, y, w, h); } else { try { ServiceFactory factory = new ServiceFactory(); wlz = factory.getInstance(WlzService.class); } catch (DependencyException e) { throw new FormatException(NO_WLZ_MSG, e); } if (wlz != null) { wlz.open(currentId, "r"); buf = wlz.readBytes(no, buf, x, y, w, h); } } return buf; }
/** * @see loci.formats.IFormatReader#openBytes(int, byte[], int, int, int, int) */ @Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.checkPlaneParameters(this, no, buf.length, x, y, w, h); if (wlz != null) { buf = wlz.readBytes(no, buf, x, y, w, h); } else { try { ServiceFactory factory = new ServiceFactory(); wlz = factory.getInstance(WlzService.class); } catch (DependencyException e) { throw new FormatException(NO_WLZ_MSG, e); } if (wlz != null) { wlz.open(currentId, "r"); buf = wlz.readBytes(no, buf, x, y, w, h); } } return buf; }