类 LengthCheckInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.tencent.cos.xml.crypto.SdkFilterInputStream
-
- com.tencent.cos.xml.crypto.LengthCheckInputStream
-
- 所有已实现的接口:
Releasable,java.io.Closeable,java.lang.AutoCloseable
public class LengthCheckInputStream extends SdkFilterInputStream
-
-
字段概要
字段 修饰符和类型 字段 说明 static booleanEXCLUDE_SKIPPED_BYTESstatic booleanINCLUDE_SKIPPED_BYTES
-
构造器概要
构造器 构造器 说明 LengthCheckInputStream(java.io.InputStream in, long expectedLength, boolean includeSkipped)Constructs an input stream that performs length check to ensure the number of bytes read from the underlying input stream is the same as the expected total.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidmark(int readlimit)intread()intread(byte[] b, int off, int len)voidreset()longskip(long n)-
从类继承的方法 com.tencent.cos.xml.crypto.SdkFilterInputStream
abort, abortIfNeeded, available, close, isAborted, markSupported, release
-
-
-
-
构造器详细资料
-
LengthCheckInputStream
public LengthCheckInputStream(java.io.InputStream in, long expectedLength, boolean includeSkipped)Constructs an input stream that performs length check to ensure the number of bytes read from the underlying input stream is the same as the expected total.- 参数:
in- the underlying input streamexpectedLength- the total length of the data in bytes expected to be read from the underlying input stream; must be non-negative.includeSkipped- true if bytes skipped are to be considered as part of the data length; false otherwise. Typically, this parameter should be set to false for uploading data to COS, but set to true for receiving data from COS.
-
-
方法详细资料
-
read
public int read() throws java.io.IOException- 覆盖:
read在类中SdkFilterInputStream- 抛出:
java.io.IOException- if the data length read has exceeded the expected total, or if the total data length is not the same as the expected total.
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- 覆盖:
read在类中SdkFilterInputStream- 抛出:
java.io.IOException- if the data length read has exceeded the expected total, or if the total data length is not the same as the expected total.
-
mark
public void mark(int readlimit)
- 覆盖:
mark在类中SdkFilterInputStream
-
reset
public void reset() throws java.io.IOException- 覆盖:
reset在类中SdkFilterInputStream- 抛出:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- 覆盖:
skip在类中SdkFilterInputStream- 抛出:
java.io.IOException- ifincludeSkippedis true and the data length skipped has exceeded the expected total.
-
-