lukecwik commented on a change in pull request #11263: [BEAM-9325] Override
proper write method in UnownedOutputStream
URL: https://github.com/apache/beam/pull/11263#discussion_r401052104
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/util/UnownedOutputStream.java
##########
@@ -53,4 +53,9 @@ public int hashCode() {
public String toString() {
return MoreObjects.toStringHelper(UnownedOutputStream.class).add("out",
out).toString();
}
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ out.write(b, off, len);
Review comment:
Leave the bounds checking to the part of the system that accesses the
`byte[]` otherwise every layer will perform the same validation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services