本文整理汇总了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;
}