亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? contentstorage.java

?? 手機郵箱撒的方式方式方式的
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
     * Do the work of adding the content to the storage. Calls the method     * {@link #ensurePrealocating} before adding the content.     *     * @param content     * @param safeMode     *     * @throws Exception if it was not stored whole content.     */    private void addToContentEnsurePreallocating(String content, boolean safeMode) throws Exception {        //checkSizeOfBodyPart(content.length());        ensurePrealocating();        long sizeAdded = 0;        try {            sizeAdded = addToContent(content, safeMode);        } catch (Exception exception) {            throw exception;        } finally {            handleAfterAdding(sizeAdded, Functions.getStringByteSize(content));        }    }        private void addToContentEnsurePreallocating(byte[] content, boolean safeMode) throws Exception {        //checkSizeOfBodyPart(content.length);                ensurePrealocating();        long sizeAdded = addToContentRaw(content, safeMode);        handleAfterAdding(sizeAdded, content.length);    }    /**     * Adds given byte array to the content of the bodypart.     * If passed content cannot be saved tries to shorten the content and     * save it partially.     *     * This method neither sets the size of the bodypart nor the state of the     * bodypart. This is done by methods inside class <code>ContentStorage<code/>     * that calls this method.     *      * This is a low-level method, saves bodypart always as a binary data regardless     * of the body part header. More high level method is addToContent(String)     *     * Before calling this method, method {@link #ensurePrealocating} is always     * called.     *      * @param content the content of the bodypart     * @param safeMode if save mode is true, the content will be not saved     *  to new persistent storage, but to temporary one     * @return the size of content that was added to the content.     *  content.length if all the content was written.     */    protected abstract long addToContentRaw(byte[] content, boolean safeMode) throws Exception;    /**     * Gets given part of the content stored in this storage. First calling of     * this method gets first part of the content. If there is another part, next     * calling gets another part. If the returned part is the last, next returned     * part will be first.     * It can be determined whether next calling of this method will return first     * part of the content by calling method willReturnFirstContent()     * This method tries to get the part of maximum possible size. It loads the     * content of this storage until it is reached the end of the storage or     * it is not enough memory. Thats why the number of calling of getContent to      * get whole content of this storage is typically less than number of calling      * of method addToContent used to bufferContent the same content.     *      * @return given part of the content stored in this storage     *      * @throws MyException if the loading of the content was not successful     */    public abstract String getNotRawContent() throws Throwable;        /**     * TODO: comment     * @return     * @throws Throwable     */    public String getContent() throws Throwable {        if (!isContentRaw()) {            return getNotRawContent();        } else {            return getContentRawAsString();        }    }        /**     * Gets raw body part content as string that contains raw (not     * encoded) content of body part content.     */    private String getContentRawAsString() {        if (DEBUG) System.out.println("DEBUG - ContentStorage.getContentRawAsString - is converted mode = " + bodyPart.convertedContentMode());        byte[] rawByteArray;        try {            rawByteArray = getContentRaw();            if (DEBUG) System.out.println("DEBUG - ContentStorage.getContentRawAsString - length of rawByteArray = " + rawByteArray.length);        } catch (MyException ex) {            ex.printStackTrace();            rawByteArray = new byte[0];        }        return getStringWithRawContentFromByte(rawByteArray);    }        /**     * Gets string from byte array with raw (not encoded) content of     * this array.     */    private String getStringWithRawContentFromByte(byte[] rawByteArray) {        StringBuffer rawSB = new StringBuffer(rawByteArray.length);        rawSB.setLength(rawByteArray.length);        for (int i = 0; i < rawByteArray.length; i++) {            rawSB.setCharAt(i, (char)rawByteArray[i]);        }        return rawSB.toString();    }        /**     * Sends content to given output connection.     * @param connection the connection to that send the content.     * @throws mujmail.MyException     */    public void getContent(DataOutputStream outputStream) throws Throwable {        do {            if (isContentRaw()) {                outputStream.write(getContentRaw());            } else {                outputStream.write(getContent().getBytes("utf-8"));            }        } while (!willReturnFirstContent());        outputStream.flush();    }        /**     * Sends the content of this storage to given connection.     *      * @param connection the connection to that send the data.     * @param sendingMode sending mode.     * @param returnSendedData true if sent data should be returned.     * @return the data sent to the connection if returnSendedData is true     *  "" if returnSendedData is false     * @throws java.lang.Exception     */    public abstract String sendContentToConnection(ConnectionInterface connection,             MailSender.SendingModes sendingMode,             boolean returnSendedData) throws Throwable;        /**     *      * @return true if next calling of getContent or getContentRaw will return     *  first part of the content.     */    public abstract boolean willReturnFirstContent();        /**     * After calling this method, getContent or getContentRaw will return     *  first part of the content.     */    public abstract void resetToFirstContent();    /**     * Gets given part of the content stored in this storage. First calling of     * this method gets first part of the content. If there is another part, next     * calling gets another part. If the returned part is the last, next returned     * part will be first.     * It can be determined whether next calling of this method will return first     * part of the content by calling method willReturnFirstContent()     * This method tries to get the part of maximum possible size. It loads the     * content of this storage until it is reached the end of the storage or     * it is not enough memory. Thats why the number of calling of getContent to      * get whole content of this storage is typically less than number of calling      * of method addToContent used to bufferContent the same content.     *      * @return given part of the content stored in this storage represented as     *  binary data.     *      * @throws MyException if the loading of the content was not successful     */    public abstract byte[] getContentRaw() throws MyException;    /**     * Gets the size of the content stored in this storage.     * @return the size of content stored in this storage     */    public long getSize() {        return size;    }    /**     * Sets the size of the content stored in this storage     * @param size the new size of content stored in this storage     */    public void setSize(long size) {        this.size = size;    }    /**     * Enumeration class which defines copying modes of the body part storage.     * Used in copy constructor of body part storage.     */    public static class CopyingModes {        private CopyingModes() {};        /** Make deep copy. Original and new storages will store identical         but independent content. */        public static final CopyingModes DEEP_COPY = new CopyingModes();        /** Makes shallow copy. Original and new storages will share this         one content.         Note, that this is allowed only if the body part which content is         in the same box. */        public static final CopyingModes SHALLOW_COPY = new CopyingModes();        /**         * Creates empty storage of the same type as original storage.         */        public static final CopyingModes NO_COPY = new CopyingModes();    }    /**     * The enumeration of all possible storage types of body part.     */    public static class StorageTypes {        private static byte counter = 0;        private final byte number;        private final String name;        private StorageTypes(String name) {            number = counter++;            this.name = name;        }        /**         * Gets unique number identifying this storage type.         * @return the number identifying this storage type         */        public byte getStorageTypeNumber() {            return number;        }        public String toString() {            return name;        }        //#ifdef MUJMAIL_FS        /** This storage uses filesystem to store the content of body part */        public static final StorageTypes FS_STORAGE = new StorageTypes("filesystem storage");        //#endif        /** This storage uses rms database to store the content of body part */        public static final StorageTypes RMS_STORAGE = new StorageTypes("rms storage");    }        /**     * Sets correct state of bodypart after adding. If it was added less than it     * should be added, deletes whole bodypart in the case that the bodypart is     * not partially saveable. If it partially saveable, sets the state to partiall.     * @param sizeWasAdded     * @param sizeShouldBeAdded     * @throws java.lang.Exception if sizeWasAdded < sizeShouldBeAdded     */    private void handleAfterAdding(long sizeWasAdded, long sizeShouldBeAdded) throws Exception {        if (sizeWasAdded == sizeShouldBeAdded) {            getBodyPart().setBodyState(BodyPart.BS_COMPLETE);            setSize(getSize() + sizeWasAdded);            return;        }        if (!MessageHeader.canBePartiallySaved(getBodyPart())) {            deleteContent();            throw new Exception("It was not possible to save whole content of bodypart. Bodypart deleted.");        }        getBodyPart().setBodyState(BodyPart.BS_PARTIAL);        setSize(getSize() + sizeWasAdded);        throw new Exception("It was not possible to save whole content of bodypart. Bodypart saved only partially.");    }        /**     * Adds the data to the content. This means decodes it, saves it to appropriate     * buffer and writes it when the memory is out or when flush method was called.     *      * The data can be decoded either to String or to byte[] so object of this     * class contains one buffer that stores String data and flushes the content     * to this ContentStorage using method addToContent(String, boolean) and one     * buffer that stores byte[] data and flushes the content to this      * ContentStorage using method addToContentRaw(byte[], boolean).     */    private class BufferedContentAdder {        /** Contains String data and flushes the output using addToContent. */        private AddToContentBuffer contentBuffer = new AddToContentBuffer();        /** Contains byte[] data and flushes the output using addToContentRaw. */        private AddToContentRawBuffer contentRawBuffer = new AddToContentRawBuffer();                /**         * Decodes given string according to the encoding of the body part that         * content this storage stores and stores it to appropriate buffer.         *          * @param bf the string which content store.         */        public void bufferContent(String bf) throws Exception {            try {                if (isContentRaw()) {                    decodeAndBufferRawContent(bf);                } else {                    decodeAndBufferContent(bf);                }            } catch (Exception e) {                e.printStackTrace();                //throw new Exception(); //TODO: why to throw new _empty_ exception ?                throw e; // rethrow            } finally {                            }            ensurePrealocating();        }                /**         * Clears the buffers cache.         */        public void clearCache() {            contentBuffer.clearCache();            contentRawBuffer.clearCache();        }                /**         * Forces the data to be written from buffers to this ContentStorage.         *          * @throws java.lang.Exception         */        public void flush() throws Exception {            System.out.println("Flushing buffers: ");            if (contentBuffer.bufferSize() != 0) {                contentBuffer.flush();            } if (contentRawBuffer.bufferSize() != 0) {                contentRawBuffer.flush();            }        }        private void decodeAndBufferContent(String bf) throws Exception {            String decoded = null;            try {                decoded = decodeNotRawBodypartData(bf);            } catch (Exception exception) {                flush();                System.gc();                decoded = decodeNotRawBodypartData(bf);            }            contentBuffer.write(decoded);        }        private void decodeAndBufferRawContent(String bf) throws Exception, Exception {            byte[] decoded = null;            try {                if (bodyPart.convertedContentMode()) {                    decoded = bf.getBytes();                } else {                    decoded = Decode.decodeBase64(bf).toByteArray();                }            } catch (Exception exception) {                flush();                System.gc();                System.out.println("*** decoding bf = "+bf);                decoded = Decode.decodeBase64(bf).toByteArray();            }                        contentRawBuffer.write(decoded);        }    }        /**     * StringOutpuBuffer that writes the data out from the buffer using method     * addToContent.     */    private class AddToContentBuffer extends OutputBuffer.StringOutputBuffer {        protected void writeDataFromBuffer(String bufferData) throws Exception {            addToContentEnsurePreallocating(bufferData, Settings.safeMode);        }            }        /**     * ByteOutpuBuffer that writes the data out from the buffer using method     * addToContentRaw.     */    private class AddToContentRawBuffer extends OutputBuffer.ByteOutputBuffer {        protected void writeDataFromBuffer(byte[] bufferData) throws Exception {            addToContentEnsurePreallocating(bufferData, Settings.safeMode);        }            }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久蜜桃香蕉精品一区二区三区| 日韩一区二区三区视频在线观看| 久久精品国产色蜜蜜麻豆| 亚洲人成亚洲人成在线观看图片 | 亚洲国产视频直播| 亚洲人吸女人奶水| 亚洲第一福利视频在线| 亚洲小少妇裸体bbw| 三级精品在线观看| 美日韩一区二区三区| 九九精品一区二区| 精品系列免费在线观看| 国产九九视频一区二区三区| 岛国精品在线播放| www.欧美色图| 欧美日韩国产高清一区| 日韩欧美一级在线播放| 国产日韩av一区二区| 国产精品久久久久久久久果冻传媒 | 99re热视频精品| 欧美亚洲综合在线| 日韩欧美精品三级| 日本一区二区视频在线| 亚洲色图一区二区| 免费成人av在线播放| 国产福利一区二区三区视频 | 欧美卡1卡2卡| 欧美变态tickle挠乳网站| 国产性做久久久久久| 亚洲欧洲精品一区二区三区不卡| 亚洲男同性视频| 捆绑调教一区二区三区| 972aa.com艺术欧美| 欧美男生操女生| 久久毛片高清国产| 一区二区三区中文在线| 久久 天天综合| bt欧美亚洲午夜电影天堂| 欧美日韩国产片| 国产日韩亚洲欧美综合| 午夜欧美2019年伦理| 国产v日产∨综合v精品视频| 欧美日韩激情在线| 国产日韩欧美电影| 亚洲成人免费在线| 99久久国产综合精品女不卡| 91精品欧美一区二区三区综合在| 中文字幕中文在线不卡住| 日本女人一区二区三区| 91美女福利视频| 精品少妇一区二区| 亚洲一区二区视频在线| 国产91精品免费| 欧美电影免费观看高清完整版在线观看| 国产精品三级久久久久三级| 久久精品国产色蜜蜜麻豆| 欧美午夜精品久久久| 亚洲欧美在线观看| 国产1区2区3区精品美女| 日韩精品一区二区三区视频 | 国产精品18久久久久久久久| 欧美一区二区三区播放老司机| 亚洲免费av高清| 国产91精品免费| 欧美精品一区二区不卡| 免费在线成人网| 欧美电影在哪看比较好| 亚洲成va人在线观看| 91福利视频在线| 尤物在线观看一区| 在线观看亚洲成人| 亚洲一区二区在线观看视频 | 欧美日韩精品久久久| 一卡二卡三卡日韩欧美| 色狠狠一区二区| 亚洲卡通欧美制服中文| 99精品热视频| 亚洲精选免费视频| 在线观看精品一区| 亚洲国产三级在线| 宅男在线国产精品| 免费成人av在线播放| 精品盗摄一区二区三区| 国产一区二区调教| 中文字幕一区免费在线观看| 99精品视频在线观看| 亚洲欧美日韩国产综合| 欧美日韩一区二区在线观看| 五月天激情综合网| 日韩欧美一区二区免费| 国内国产精品久久| 欧美激情一区不卡| 色婷婷亚洲婷婷| 性做久久久久久免费观看| 欧美精选一区二区| 久久国产综合精品| 久久久综合激的五月天| 高清不卡一二三区| 亚洲精品乱码久久久久久| 欧美剧在线免费观看网站| 美女视频黄频大全不卡视频在线播放| 久久青草欧美一区二区三区| 不卡的av电影在线观看| 亚洲一区二区三区四区在线观看 | 国产日韩影视精品| 在线欧美小视频| 精品一区二区三区视频在线观看| 国产欧美日韩激情| 欧美性大战久久久| 国产福利一区二区| 亚洲一区二区三区免费视频| 久久久久久99精品| 欧美私人免费视频| 成人短视频下载| 日本视频在线一区| 中文成人av在线| 欧美一级一级性生活免费录像| 国产精品一区二区x88av| 一区二区三区久久| 国产视频在线观看一区二区三区| 欧美午夜精品一区| 成人午夜伦理影院| 奇米影视一区二区三区小说| 18涩涩午夜精品.www| 久久亚洲二区三区| 5566中文字幕一区二区电影 | 欧美一区二区三区在线| 欧美疯狂性受xxxxx喷水图片| 国产成人免费视频一区| 三级不卡在线观看| 亚洲一区二区av在线| 国产精品私人自拍| 精品欧美久久久| 欧美一区二区在线免费观看| 91在线视频免费观看| 国产高清精品在线| 国产尤物一区二区在线| 免费黄网站欧美| 日韩avvvv在线播放| 亚洲已满18点击进入久久| 国产精品电影一区二区| 亚洲国产高清aⅴ视频| 国产亚洲精品aa| 日韩精品一区在线观看| 欧美一区二区三区色| 在线播放视频一区| 88在线观看91蜜桃国自产| 欧美色成人综合| 欧美视频在线不卡| 欧美色老头old∨ideo| 欧洲另类一二三四区| 日本黄色一区二区| 欧美探花视频资源| 69成人精品免费视频| 91麻豆精品国产91久久久资源速度| 欧美三级韩国三级日本一级| 欧美男男青年gay1069videost | 午夜精品久久久久久久| 午夜精品久久久久久久蜜桃app| 亚洲一区二区三区视频在线 | 成人黄色小视频| av不卡免费电影| 色悠悠久久综合| 在线免费观看一区| 欧美日韩国产经典色站一区二区三区| 欧美日韩在线不卡| 日韩丝袜美女视频| 久久婷婷国产综合精品青草| 国产欧美日韩另类视频免费观看| 国产精品欧美精品| 亚洲欧美日韩国产中文在线| 天天影视涩香欲综合网| 蜜桃视频在线一区| 国产精品1024久久| 色综合天天综合网天天看片| 欧美午夜电影一区| 欧美大黄免费观看| 亚洲国产精品ⅴa在线观看| 亚洲三级在线免费| 免费视频最近日韩| 成人性生交大片免费看中文| 色国产综合视频| 日韩精品一区二区三区视频| 日本一二三四高清不卡| 亚洲综合999| 韩国女主播一区二区三区| 97成人超碰视| 日韩欧美精品三级| 夜夜嗨av一区二区三区四季av| 久久99精品国产麻豆婷婷洗澡| 95精品视频在线| 日韩精品一区国产麻豆| 亚洲天天做日日做天天谢日日欢 | 一区二区三区免费网站| 蜜臀久久久久久久| 99久久夜色精品国产网站| 日韩欧美一区电影| 亚洲乱码一区二区三区在线观看| 麻豆91在线看| 欧美日韩一区二区不卡|