4,382 questions
0
votes
0
answers
83
views
Having issues where Java StreamingResponseBody is null
Does anyone see any issues with the below code? I'm experiencing issues where the StreamingResponseBody returned by this method is null and no content is returned in the ResponseEntity body of the ...
0
votes
0
answers
36
views
is BodyInserters.fromResource (for WebCLient) an auto-closing resource
I'm trying to send data from minio (s3) to another service. Do I need to close the resource myself after sending?
public void uploadResource(InputStream coilsMapStream) {
Mono<Void> response ...
1
vote
0
answers
65
views
Android Kotlin uri to InputStream
I'm doing a project to read Excel files from my phone and output the data to the screen.
This is how I try to do it:
private fun readDataExel() {
val file = Uri.parse("content://com....
2
votes
1
answer
183
views
How to read a big Json string value as a stream in Java
I'm receiving a JSON DTO containing a b64 file in one of its fields.
That file can be quite big (100MiB+ - don't ask) and I'm trying to read it as a stream from the JSON to reduce the load on memory. ...
0
votes
1
answer
61
views
Fetching characters from a Buffer while reading Ints
I am building a language interpreter and needs to have two functions, one to input an integer and another to input a character (from System.in). For instance, inputting integer - character - integer - ...
1
vote
0
answers
38
views
InputStream misses some bytes reading file via FTP
I'm trying to download a ZIP file on Android via FTP.
Problem is that sometimes the received file has some bytes missing towards the end.
This doesn't happen using InputStream/OutputStream on local ...
0
votes
0
answers
51
views
InputStreamReader.read never finishes reading and never returns
I have an InputStream and the following code works, reading some bytes from the input stream and creating a string with them:
byte[] buffer = new byte[1024];
int i = in.read(buffer, 0, 1024); //"...
0
votes
2
answers
61
views
Android Bluetooth Socket Read String From InputStream Skips Lines
I am developing an Android bluetooth app that will have a terminal communication between Arduino and Android. The communication works but the inputstream reads and creates seperate strings from the ...
0
votes
1
answer
40
views
Cache InputStream for annotated methods
I want to cache the input stream of certain endpoints,
have been able to achieve this only for all endpoints.
tried creating an interceptor that turns on caching per method annotation
this fails ...
3
votes
1
answer
728
views
How to strip EXIF Metadata from an Image before uploading to S3 without loading the entire file into memory
I have a service that uploads images to AWS S3 using a MultipartFile. These images are later served as public files. There is a security concern: these images might contain sensitive EXIF metadata (e....
0
votes
1
answer
94
views
Stream Closed error for accessing .yml file
Unable to access the .yml file as the it is not getting read. Not sure if the path is wrong or that given I am on Mac, I need different way for path setup.
I am trying to access .yml which is housed ...
-2
votes
1
answer
633
views
Using Spring WebClient to upload a file as inputstream [closed]
Im using a webflux springboot application. where i have an API which takes a FilePart as input and then convert it to inputstream since i make a filetype check using Tika library and then upload this ...
1
vote
1
answer
138
views
InputStream.available() strange behavior
I have the source code of a running project - that is unfortunately already deployed to customers.
The following Java code is running the update process :
public void downloadChanges() throws ...
1
vote
0
answers
120
views
Java/terminal issues when getting and printing out utf-8 encoded strings
I've wanted to make an utf 8 supported chatroom, but it didn't work only for some specific utf 8 characters, so after spending a week in pure frustration, i narrowed it down to something being wrong ...
0
votes
0
answers
138
views
Read a String with TCP Sockets in Kotlin
I have a TCP Socket implementation in Kotlin and use the code below to read a String (using a BufferedReader):
val readBuffer = BufferedReader(InputStreamReader(socket.inputStream))
private fun ...