### 25.2 P2 — "상한을 두고 읽는다"는 본문 핸들러가 전부 읽은 뒤에 자른다

```java
// JdkNotificationHttpGateway.java:116-128
/**
 * A body handler that stops reading at the cap.
 * ...
 */
private static HttpResponse.BodyHandler<byte[]> boundedBody(int maxBytes) {
  return responseInfo ->
      HttpResponse.BodySubscribers.mapping(
          HttpResponse.BodySubscribers.ofByteArray(),
          body -> body.length <= maxBytes ? body : java.util.Arrays.copyOf(body, maxBytes));
}
```
