code: public void init(Channel channel, long writtenAmount) {
          if (channel == null) {
              throw new NullPointerException("channel");
          }
          if (writtenAmount <= 0) {
              throw new IllegalArgumentException(
                      "writtenAmount must be a positive integer: " + writtenAmount);
          }
  
          this.channel = channel;
          this.writtenAmount = writtenAmount;
      }
docs: Initializes the instance.