Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:24:10+00:00 2026-06-17T07:24:10+00:00

I hope you can help me with this: I’m trying to write a Milkshape3D

  • 0

I hope you can help me with this:
I’m trying to write a Milkshape3D model loader for Java.
I have found the Milkshape3D File Format Specification here
and following it I created my code as belows, Im missing some classes still, but this problem came by now; with a DataInputStream object I should be able to read the file by whatever data type I want, like with readChar() I should be able to read all of the chars in the file header, wich should be “MS3D000000”, but when I use readChar() to get only the “M”, it returns a weird symbol, and even if I skip the first 10 bytes to read the version number, it returns a number very different than 3!!

I dont know what to do, can you explain me what am I doing wrong?
The model can be found here

package milkshape3d_loader;

import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;

class ms3d_header_t {
    char[]  id;         // always "MS3D000000"
    int     version;    // 3
    ms3d_header_t() {
        id = new char[] {'M','S','3','D','0','0','0','0','0','0'};
        version = 3;
    }
}

public class Milkshape3D_Loader {

    public static void main(String[] args) {

        try {
            File inFile = new File ("dy_joey.ms3d");
            FileInputStream inStream = new FileInputStream (inFile);
            DataInputStream input = new DataInputStream (inStream);

            char id = input.readChar();
            System.out.println (id);

        }

        catch (Exception e) {
        System.out.println (e.getMessage());
        e.printStackTrace();
        }        
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:24:11+00:00Added an answer on June 17, 2026 at 7:24 am

    readChar reads two bytes and interprets them as a single char – a 16 bit UTF-16 code unit. The “weird symbol” is presumably U+4D53, the Unicode character represented by the bytes corresponding to ASCII M and S. You probably need to read each byte individually using

    char id = (char)input.readUnsignedByte();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope you can help. This has been confounding me for hours. I have
I hope some of you guys can help me with this problem.... I have
I hope someone can help with this please. I am trying to query an
Hope someone can help with this. I have multiple tables with millions items and
I hope someone can help with this. I have written a function which adds
I really hope someone can help on this because I'm learning cocoa and have
Hope someone can help me with this issue. I'm trying to open an info
I hope someone can help with this. I have created a map app that
Hope you can help me with this, (again in some cases!) I have a
Hope you can help me with this: So, I have Nivo slider working fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.