File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
gateway-ha/src/main/java/io/trino/gateway/proxyserver Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,15 @@ public ServletInputStream getInputStream()
4545 @ Override
4646 public boolean isFinished ()
4747 {
48- return byteArrayInputStream .available () > 0 ;
48+ // Determine if data is available for reading.
49+ return byteArrayInputStream .available () <= 0 ;
4950 }
5051
5152 @ Override
5253 public boolean isReady ()
5354 {
54- return false ;
55+ // It's an in memory stream, so it's ready to be read
56+ return true ;
5557 }
5658
5759 @ Override
@@ -63,6 +65,21 @@ public int read()
6365 {
6466 return byteArrayInputStream .read ();
6567 }
68+
69+ // Add multibyte read versions for efficiency
70+ @ Override
71+ public int read (byte [] b , int off , int len )
72+ throws IOException
73+ {
74+ return byteArrayInputStream .read (b , off , len );
75+ }
76+
77+ @ Override
78+ public int read (byte [] b )
79+ throws IOException
80+ {
81+ return byteArrayInputStream .read (b );
82+ }
6683 };
6784 }
6885
You can’t perform that action at this time.
0 commit comments