/** * Constructor * * @param erd the escher record data */ public BlipStoreEntry(EscherRecordData erd) { super(erd); type = BlipType.getType(getInstance()); write = false; byte[] bytes = getBytes(); referenceCount = IntegerHelper.getInt(bytes[24], bytes[25], bytes[26], bytes[27]); }
/** * Constructor * * @param d the drawing * @exception IOException */ public BlipStoreEntry(Drawing d) throws IOException { super(EscherRecordType.BSE); type = BlipType.PNG; setVersion(2); setInstance(type.getValue()); byte[] imageData = d.getImageBytes(); imageDataLength = imageData.length; data = new byte[imageDataLength + IMAGE_DATA_OFFSET]; System.arraycopy(imageData, 0, data, IMAGE_DATA_OFFSET, imageDataLength); referenceCount = d.getReferenceCount(); write = true; }
BlipStoreEntry bse = (BlipStoreEntry) children[d.getBlipId() - 1]; bse.dereference(); if (bse.getReferenceCount() == 0)
data = getBytes(); return setHeaderData(data);
BlipStoreEntry bse = new BlipStoreEntry(d); if (d.getOrigin() == Origin.WRITE) BlipStoreEntry bse = new BlipStoreEntry(d); bstoreCont.add(bse);
/** * Accessor for the image data. * * @return the image data */ byte[] getImageData() { byte[] allData = getBytes(); byte[] imageData = new byte[allData.length - IMAGE_DATA_OFFSET]; System.arraycopy(allData, IMAGE_DATA_OFFSET, imageData, 0, imageData.length); return imageData; } }
/** * Gets the drawing data for the given blip id. Called by the Drawing * object * * @param blipId the blipId * @return the drawing data */ byte[] getImageData(int blipId) { numBlips = getBStoreContainer().getNumBlips(); Assert.verify(blipId <= numBlips); Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE); // Get the blip EscherRecord[] children = getBStoreContainer().getChildren(); BlipStoreEntry bse = (BlipStoreEntry) children[blipId - 1]; return bse.getImageData(); }
BlipStoreEntry bse = (BlipStoreEntry) children[d.getBlipId() - 1]; bse.dereference(); if (bse.getReferenceCount() == 0)
data = getBytes(); return setHeaderData(data);
BlipStoreEntry bse = new BlipStoreEntry(d); if (d.getOrigin() == Origin.WRITE) BlipStoreEntry bse = new BlipStoreEntry(d); bstoreCont.add(bse);
/** * Accessor for the image data. * * @return the image data */ byte[] getImageData() { byte[] allData = getBytes(); byte[] imageData = new byte[allData.length - IMAGE_DATA_OFFSET]; System.arraycopy(allData, IMAGE_DATA_OFFSET, imageData, 0, imageData.length); return imageData; } }
/** * Gets the drawing data for the given blip id. Called by the Drawing * object * * @param blipId the blipId * @return the drawing data */ byte[] getImageData(int blipId) { numBlips = getBStoreContainer().getNumBlips(); Assert.verify(blipId <= numBlips); Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE); // Get the blip EscherRecord[] children = getBStoreContainer().getChildren(); BlipStoreEntry bse = (BlipStoreEntry) children[blipId - 1]; return bse.getImageData(); }
/** * Constructor * * @param erd the escher record data */ public BlipStoreEntry(EscherRecordData erd) { super(erd); type = BlipType.getType(getInstance()); write = false; byte[] bytes = getBytes(); referenceCount = IntegerHelper.getInt(bytes[24], bytes[25], bytes[26], bytes[27]); }
/** * Constructor * * @param d the drawing * @exception IOException */ public BlipStoreEntry(Drawing d) throws IOException { super(EscherRecordType.BSE); type = BlipType.PNG; setVersion(2); setInstance(type.getValue()); byte[] imageData = d.getImageBytes(); imageDataLength = imageData.length; data = new byte[imageDataLength + IMAGE_DATA_OFFSET]; System.arraycopy(imageData, 0, data, IMAGE_DATA_OFFSET, imageDataLength); referenceCount = d.getReferenceCount(); write = true; }
newRecord = new BlipStoreEntry(erd);
newRecord = new BlipStoreEntry(erd);