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 7992995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:43:36+00:00 2026-06-04T13:43:36+00:00

i have this RandomAccessFile object that reads bytes from a file and stores them

  • 0

i have this RandomAccessFile object that reads bytes from a file and stores them into a byte array. they should compose a hebrew letter string.
if i debug them in JAVA on a desktop, then for 4 bytes in hex i get, for example:

data[0]=E7
data[1]=FA
data[2]=E5
data[3]=EC

(so, 1 byte length each which makes sense)

when i construct a String str from them i get:

str[0]=\u05D7
str[1]=\u05EA
str[2]=\u05D5
str[3]=\u05DC

which are the correct unicoded hebrew letters and the string print out just fine. are they 2 bytes length each?

when i do the same debugging on an Android device i get the same “data” byte array but the “str” string is 4 identical bytes which reads out as 4 question mark.

my question is: how can java take 1 byte and “know” it’s hebrew, and how can i do it in Android just the same?

thanks

code:

iDefLength=4;
RandomAccessFile R = new RandomAccessFile(file, "r");       
R.read(bDefinition, 0, iDefLength);
this.sDef = new String(bDefinition);
  • 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-04T13:43:37+00:00Added an answer on June 4, 2026 at 1:43 pm

    As for your question: No, Java cannot take 1 byte and know it’s Hebrew, or any other encoding.

    While it’s possible to make an encoding guess by doing stuff like looking at many/all bytes in the file and guessing the encoding by looking at byte frequencies (I believe Microsoft does this with IE), obviously that can’t work on a single byte.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have some code that reads a certain amount of bytes from a
Have this print output from print_r($theobject); SimpleXMLElement Object ( [@attributes] => Array ( [label]
Hi I have some code that uses block RandomAccessFile file = new RandomAccessFile(some file,
I have a .java src file that looks like this: class Test { public
I have a RandomAccessFile raFile from which I'm reading data into a buffer in
I have this array in PHP: array( [0] => array( 'username' => 'user1' )
We have this software that has a webservices component. Now, the administrator of this
I have this DependencyProperty which holds an entity with a property that is a
I have this batch that needs to run that the user has to execute
Hi I am a novice in JAVA. I have been getting this file not

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.