Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Binary File. Extract float data from binary file and put into array

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Binary File. Extract float data from binary file and put into array

    Hello,

    I have a binary file that contains floating point numbers and is in little endian (this last part I don't think is very important). I would like to read the numbers from this file and and put them into an array.

    I have done some research and I cannot figure out how to do this. I know that there are InputStream, FileInputStream, DataInputStream, and BinaryInputStream classes that have the methods that will get this done, but I have not been successful at anything. I know that FileInputStream takes a file as its constructor and that DataInputStream has readFloat().

    Does anyone know of code on the Internet that already does this? Or can anyone help me out with advice, guidance, code, etc.?

    Thanks all,


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Binary File. Extract float data from binary file and put into array

    Also posted at Binary File. Extract float data from binary file and put into array - Dev Shed
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Extract data from a file
    By kafka82 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: September 1st, 2011, 03:02 AM
  2. Reading an int from bytes(binary file) - HELP
    By yogiyogi in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 14th, 2010, 02:03 PM
  3. How to write 2 dimensional array of float numbers to binary file?
    By Ghuynh in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: June 17th, 2010, 04:26 PM
  4. How to save statistics of a game in a binary file instead of txt file?
    By FretDancer69 in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: June 19th, 2009, 05:05 AM
  5. How to convert float and double data types to binary?
    By rosh72851 in forum Java Theory & Questions
    Replies: 1
    Last Post: October 7th, 2008, 10:45 PM