本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}