/** * Accessor for the image data * * @return the image data */ public byte[] getImageData() { return super.getImageData(); }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageData() { return super.getImageData(); }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageBytes() throws IOException { if (origin == Origin.READ || origin == Origin.READ_WRITE) { return getImageData(); } Assert.verify(origin == Origin.WRITE); if (imageFile == null) { Assert.verify(imageData != null); return imageData; } byte[] data = new byte[(int) imageFile.length()]; FileInputStream fis = new FileInputStream(imageFile); fis.read(data, 0, data.length); fis.close(); return data; }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageBytes() throws IOException { if (origin == Origin.READ || origin == Origin.READ_WRITE) { return getImageData(); } Assert.verify(origin == Origin.WRITE); if (imageFile == null) { Assert.verify(imageData != null); return imageData; } byte[] data = new byte[(int) imageFile.length()]; FileInputStream fis = new FileInputStream(imageFile); fis.read(data, 0, data.length); fis.close(); return data; }
private PNGReader getPngReader() { if (pngReader != null) { return pngReader; } byte[] imdata = null; if (origin == Origin.READ || origin == Origin.READ_WRITE) { imdata = getImageData(); } else { try { imdata = getImageBytes(); } catch (IOException e) { logger.warn("Could not read image file"); imdata = new byte[0]; } } pngReader = new PNGReader(imdata); pngReader.read(); return pngReader; }
private PNGReader getPngReader() { if (pngReader != null) { return pngReader; } byte[] imdata = null; if (origin == Origin.READ || origin == Origin.READ_WRITE) { imdata = getImageData(); } else { try { imdata = getImageBytes(); } catch (IOException e) { logger.warn("Could not read image file"); imdata = new byte[0]; } } pngReader = new PNGReader(imdata); pngReader.read(); return pngReader; }