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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:07:05+00:00 2026-05-21T03:07:05+00:00

I am extracting metadata of a song using following code ,And how I can

  • 0

I am extracting metadata of a song using following code ,And how I can convert the byte array (buf) to string? Please help me,Thanks in advance.

String mint = httpConnection.getHeaderField("icy-metaint");
int b = 0;
int count =0;    
while(count++ < length){
b = inputStream.read();         
}            
int metalength = ((int)b)*16;
if(metalength <= 0)
    return;
byte buf[] = new byte[metalength];
inputStream.read(buf,0,buf.length);
  • 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-05-21T03:07:05+00:00Added an answer on May 21, 2026 at 3:07 am

    1). Read bytes from the stream:

    // use net.rim.device.api.io.IOUtilities
    byte[] data = IOUtilities.streamToBytes(inputStream);
    

    2). Create a String from the bytes:

    String s = new String(data, "UTF-8");
    

    This implies you know the encoding the text data was encoded with before sending from the server. In the example right above the encoding is UTF-8. BlackBerry supports the following character encodings:

    * "ISO-8859-1"
    * "UTF-8"
    * "UTF-16BE"
    * "US-ASCII" 
    

    The default encoding is “ISO-8859-1”. So when you use String(byte[] data) constructor it is the same as String(byte[] data, "ISO-8859-1").

    If you don’t know what encoding the server uses then I’d recommend to try UTF-8 first, because by now it has almost become a default one for servers. Also note the server may send the encoding via an http header, so you can extract it from the response. However I saw a lot of servers which put “UTF-8” into the header while actually use ISO-8859-1 or even ASCII for the data encoding.

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

Sidebar

Related Questions

I need some help extracting the following bits of information using regular expressions. Here
Need some help with extracting 2 pieces of information from the following string: viewed
Extracting the href value from the following sample HTML code is straight forward if
I want to know about the id3 metadata, I am eager in extracting the
When extracting web service calls into an abstraction so they can easily be tested
I am extracting a pdf into images / swf and text with the help
I am extracting a character in a Javascript string with: var first = str.charAt(0);
I'm extracting Android Grass live wallpaper code from the Android source. I have put
Im having trouble extracting only a matching string: OPER^ from a log4j file. I
How can I extract the text from a url? In my code it is

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.