I have an BufferedinputStream that contains the byte[] representation of a file file and before that it contains the name of file ("FileName.fileExtension") I'd like to read the first line and then read the byte representation of the file so I can Convert It to the it's extension I tried this but it didn't work and because i have to keep the byte[] representation of the file
BufferedInputStream bis=new BufferedInputStream(sr.getInputStream());
BufferedReader in=new BufferedReader(new InputStreamReader(sr.getInputStream()));
String Filename=in.readLine();
String y=in.lines().collect(Collectors.joining());