if (file instanceof IRepository.IModule) { return getModuleBuffer(); }  URL urls[] = getFileURL(file);  ByteArrayOutputStream bos = new ByteArrayOutputStream(16000);
ByteBufferOutputStream bos = new ByteBufferOutputStream( CONTENT_INITIAL_SIZE);
        public final byte[] getBuffer() throws IOException {            if (buffer != null) {                return buffer;            }            if (file instanceof IRepository.ISet) {                return getSetBuffer();            }            if (file instanceof IRepository.IModule) {                return getModuleBuffer();            }            URL urls[] = getFileURL(file);            ByteArrayOutputStream bos = new ByteArrayOutputStream(16000);            lastModificationDate = -1;            for (int i = 0; i < urls.length; i++) {                IContent contentProvider = file.getContentProvider()                        .getContent(urls[i], locale);                try {                    long date = contentProvider.getLastModified();                    if (date < 1) {                        date = System.currentTimeMillis();                    }                    if (lastModificationDate < date) {                        lastModificationDate = date;                    }                    long size = contentProvider.getLength();                    if (size == 0) {                        continue;                    }                    InputStream in = contentProvider.getInputStream();                    try {                        byte buf[];                        if (size > 0) {                            buf = new byte[(int) size];                        } else {                            buf = new byte[4096];                        }                        for (;;) {                            int ret = in.read(buf);                            if (ret < 0) {                                break;                            }                            bos.write(buf, 0, ret);                        }                    } finally {                        try {                            in.close();                        } catch (Exception ex) {                            LOG.error("Can not close inputstream '" + urls[i]                                    + "'.", ex);                        }                    }                } finally {                    contentProvider.release();                }            }            bos.close();            buffer = bos.toByteArray();            int beforeUpdate = buffer.length;            buffer = updateBuffer(buffer);            if (LOG.isInfoEnabled()) {                DateFormat dateFormat = DateFormat.getDateTimeInstance(                        DateFormat.SHORT, DateFormat.MEDIUM);                LOG.debug("Load record '" + file.getFilename() + "' into "                        + buffer.length + " bytes, modified date="                        + dateFormat.format(new Date(lastModificationDate))                        + "  (update-ratio "                        + (buffer.length * 100 / beforeUpdate) + "%)");            }            if (hasEtagSupport()) {                etag = computeETag(buffer);            }            if (hasHashSupport()) {                hash = computeHash(buffer);            }            return buffer;        }