Suppose we are in HTML 4.
GWT client cannot read files. The GWT client is javascript running in the browser. Browser security does not allow you to read local files. You must force the proxy servlet to read the file for you on the server.
You set the mime type for the file because you want the browser to download the file and call the local computer to invoke the appropriate software - for example, pdf to invoke a PDF reader or xls to invoke ms excel. Nothing to do with GWT Java or Javascript (other than to enable loading).
Why do you need a GWT client to read a binary file? If you do, your architecture is probably wrong. "Wrong" is an unkind word. Perhaps the wrong is the best word. Your AJAX Thin Client Server concept is incorrect. Leave your desktop handling concepts and door habits when you enter the GWT door.
GWT is Java, but not Java
I have to remind people all the time that GWT Java is just a more consistent view of Javascript. When you code in GWT Java, always remember that you actually code in Javascript, not Java. All Java source translated into Javascript
Therefore, the GWT compiler needs all the Java classes that will be delivered in the source code. The GWT compiler is not able to translate Java bytecode jar / class files into Javascript. If your library is in bytecode or your source library calls the bytecode library anywhere in the call chain, compilation will fail.
Confusion between server side and GWT client side
GWT RPC is sometimes a source of confusion for GWT beginners. They do not seem to understand that the remote servlet is the only part that is compiled into bytecode because it runs on the server. Especially if you use Vaadin - because they so deliberately blurred the line between the server and the browser. So, the GWT newbie wonders: "Why do my bytecode libraries work only in some parts of the application?"
Ajax client server architecture
GWT is just a web-based interface. Why can't you do what you want to do on the server and let the server reflect what it does or did with the user interface? Why should this be done in a browser?
Imagine your GWT interface is a crazy JSP. Imagine you are writing JSP. Are you getting your JSP to suck your binary data in the browser and get the JSP to generate Javascript to parse the binary data there?
I wrote complex statistical analyzes, and I just used the browser as a reflection of what is being done on the server. The engineer believes that he / she conducts the analysis on his PC. Charts / reports are created. But all this is done on the server, causing SAS.
Service Oriented Template / Architecture
Your server will provide services. Your browser The GWT client will request these services. Open the file, read the file, analyze the file, create a visual / mime representation of the analysis and transfer it to the browser. Just think of the GWT browser client as a monitor monitor for management on the server. GWT is a magical trick that will help me evoke the illusion that engineers feel like they are analyzing on a local PC. Of course, engineers, many of whom know that the browser is actually not doing its job.
When your user is satisfied with the analysis, get your service to generate a MIME presentation of the results so that it can be downloaded by the browser to invoke the corresponding local PC software displayed using mime.
Do it on the server and mirror it in the browser.
Additional changes . As for binary data ...
Base64 encoding motivation used in web applications: transferring auth tokens, images, audio files - so that their binary representation and sequence will not be spoiled by architectural nuances such as endianness.
For example, do not try to write a browser application to read the raw binary table - always translate the server into XML or JSON (preferably JSON), where any binary element must be encoded in base64 before sending it to the browser application. Or, if the goal of your life is to climb Mount Everest, come up with architectural-agnostic coding instead of base64 to transmit binary data.
Use only binary information if it was for processing the browser OS (for example, audio, images, pdf files). It makes no sense to pass binary data just for javascript processing. The javascript procedure would have to use extraneous processing time to translate it (if, again, if the goal in your life is to rise ...).