类 LengthCheckInputStream

  • 所有已实现的接口:
    Closeable, AutoCloseable

    @NotThreadSafe
    public class LengthCheckInputStream
    extends FilterInputStream
    Used to perform length check to ensure the number of bytes read from the underlying input stream is the same as the expected total.
    • 字段详细资料

      • INCLUDE_SKIPPED_BYTES

        public static final boolean INCLUDE_SKIPPED_BYTES
        另请参阅:
        常量字段值
      • EXCLUDE_SKIPPED_BYTES

        public static final boolean EXCLUDE_SKIPPED_BYTES
        另请参阅:
        常量字段值
    • 构造器详细资料

      • LengthCheckInputStream

        public LengthCheckInputStream​(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 stream
        expectedLength - 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 BCE, but set to true for receiving data from BCE.