class Aws::S3::Encryption::IOAuthDecrypter

def truncate_chunk(chunk)

def truncate_chunk(chunk)
  if chunk.bytesize + @bytes_written <= @max_bytes
    chunk
  elsif @bytes_written < @max_bytes
    chunk[0..(@max_bytes - @bytes_written - 1)]
  else
    # If the tag was sent over after the full body has been read,
    # we don't want to accidentally append it.
    ""
  end
end