类 LengthCheckInputStream

    • 构造器概要

      构造器 
      构造器 说明
      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.
    • 字段详细资料

      • INCLUDE_SKIPPED_BYTES

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

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

      • 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 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 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.
      • 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 - if includeSkipped is true and the data length skipped has exceeded the expected total.