當前位置: 首頁>>代碼示例>>Java>>正文


Java FileItemStream.ItemSkippedException方法代碼示例

本文整理匯總了Java中org.apache.commons.fileupload.FileItemStream.ItemSkippedException方法的典型用法代碼示例。如果您正苦於以下問題:Java FileItemStream.ItemSkippedException方法的具體用法?Java FileItemStream.ItemSkippedException怎麽用?Java FileItemStream.ItemSkippedException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.fileupload.FileItemStream的用法示例。


在下文中一共展示了FileItemStream.ItemSkippedException方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: read

import org.apache.commons.fileupload.FileItemStream; //導入方法依賴的package包/類
/**
 * Returns the next byte in the stream.
 *
 * @return The next byte in the stream, as a non-negative
 * integer, or -1 for EOF.
 * @throws IOException An I/O error occurred.
 */
@Override
public int read() throws IOException {
    if (closed) {
        throw new FileItemStream.ItemSkippedException();
    }
    if (available() == 0 && makeAvailable() == 0) {
        return -1;
    }
    ++total;
    int b = buffer[head++];
    if (b >= 0) {
        return b;
    }
    return b + BYTE_POSITIVE_OFFSET;
}
 
開發者ID:dueros,項目名稱:dcs-sdk-java,代碼行數:23,代碼來源:MultipartStreamCopy.java

示例2: skip

import org.apache.commons.fileupload.FileItemStream; //導入方法依賴的package包/類
/**
 * Skips the given number of bytes.
 *
 * @param bytes Number of bytes to skip.
 * @return The number of bytes, which have actually been
 * skipped.
 * @throws IOException An I/O error occurred.
 */
@Override
public long skip(long bytes) throws IOException {
    if (closed) {
        throw new FileItemStream.ItemSkippedException();
    }
    int av = available();
    if (av == 0) {
        av = makeAvailable();
        if (av == 0) {
            return 0;
        }
    }
    long res = Math.min(av, bytes);
    head += res;
    return res;
}
 
開發者ID:dueros,項目名稱:dcs-sdk-java,代碼行數:25,代碼來源:MultipartStreamCopy.java

示例3: read

import org.apache.commons.fileupload.FileItemStream; //導入方法依賴的package包/類
/**
 * Returns the next byte in the stream.
 * @return The next byte in the stream, as a non-negative
 *   integer, or -1 for EOF.
 * @throws IOException An I/O error occurred.
 */
public int read() throws IOException {
    if (closed) {
        throw new FileItemStream.ItemSkippedException();
    }
    if (available() == 0) {
        if (makeAvailable() == 0) {
            return -1;
        }
    }
    ++total;
    int b = buffer[head++];
    if (b >= 0) {
        return b;
    }
    return b + BYTE_POSITIVE_OFFSET;
}
 
開發者ID:actframework,項目名稱:actframework,代碼行數:23,代碼來源:MultipartStream.java

示例4: skip

import org.apache.commons.fileupload.FileItemStream; //導入方法依賴的package包/類
/**
 * Skips the given number of bytes.
 * @param bytes Number of bytes to skip.
 * @return The number of bytes, which have actually been
 *   skipped.
 * @throws IOException An I/O error occurred.
 */
public long skip(long bytes) throws IOException {
    if (closed) {
        throw new FileItemStream.ItemSkippedException();
    }
    int av = available();
    if (av == 0) {
        av = makeAvailable();
        if (av == 0) {
            return 0;
        }
    }
    long res = Math.min(av, bytes);
    head += res;
    return res;
}
 
開發者ID:actframework,項目名稱:actframework,代碼行數:23,代碼來源:MultipartStream.java


注:本文中的org.apache.commons.fileupload.FileItemStream.ItemSkippedException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。