How can I automatically tell the difference between a character file and a binary file in JAVA?

Posted on 2003-03-06
Medium Priority
Last Modified: 2010-04-17
I am streaming a combination of character files and binary files into my Java application.  Is there an elegant way of determining if a file is either a binary file or a character file?  This way I can use a combination of FileInputStream and FileWriter.

Many thanks in advance

Question by:Steve23
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 8089530
Doh! Never mind, figured out how to do this by mapping different directory paths to one directory. This created a kind of virtual directory structure.  This was all done on the FTP server.

Accepted Solution

Rashimus earned 480 total points
ID: 8175418
Pour some water over them,

The Character file will turn green, whilst the binary file will turn blue.

Maybe say a magic word or too..

Good luck...

Author Comment

ID: 8175475
Ill try that!  Lucky thing that ive got my Harry Potter book of spells.

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question