You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: io_auth_decrypter.rb
    path of file: ./repos/aws-sdk-ruby/gems/aws-sdk-s3/lib/aws-sdk-s3/encryptionV2
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Aws
  module S3
    module EncryptionV2
      # @api private
      class IOAuthDecrypter

        # @option options [required, IO#write] :io
        #   An IO-like object that responds to {#write}.
        # @option options [required, Integer] :encrypted_content
    
        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