kgyrtkirk commented on code in PR #17652:
URL: https://github.com/apache/druid/pull/17652#discussion_r1971308470
##########
processing/src/main/java/org/apache/druid/io/LimitedOutputStream.java:
##########
@@ -88,6 +88,11 @@ public void close() throws IOException
out.close();
}
+ public OutputStream get()
+ {
+ return out;
+ }
Review Comment:
this class is already an `OutputStream`.
this seems like a weaking of the class; with a callsite level direct cast...
```
((ByteArrayOutputStream) Preconditions.checkNotNull(cacheObjectStream,
"cacheObjectStream")
.get()).toByteArray();
```
I see only one uses of this method when it tries to flatten it to a
bytearray - wouldn't it be better to have a `toByteArray` or something here
(throw DruidException if you can't answer that) ?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]