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

  • Home
  • SEARCH
  • 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 6679871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:24:33+00:00 2026-05-26T04:24:33+00:00

I am making a little experiment with WebSockets and Java. Apperantly, according to the

  • 0

I am making a little experiment with WebSockets and Java. Apperantly, according to the last draft of WebSocket, the message can be binary or a plain string. I use Webbit server and it has two functions:

public void onMessage(WebSocketConnection connection, String message) 

public void onMessage(WebSocketConnection connection, byte[] message)

I wonder what makes a difference. Is byte[] faster? Or why does it matter? I can write everything I write with the bytes because even a string is composed into bytes while transfer, so why do we have two multiple methods? Only Google Chrome 15 Beta and 16 Dev supports binary transfer, so I was thinking of using Base64 encoding/decoding on both client and server. Is this the only difference? What if I just read each byte, compose them into a string and send them? I think, only difference will be that not all bytes are String chars, so I wouuld just add an overhead when converting to a String?

tl;dr -> What is the difference between Binary transfer and String transfer?

  • 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-26T04:24:34+00:00Added an answer on May 26, 2026 at 4:24 am

    The WebSocket protocol (HyBi) supports two different payload types: text, binary. The text payload is UTF-8 encoded string data. Any ASCII codes above 127 in the string that you send will be converted into a two-byte UTF-8 encoding. To successfully send/receive raw binary data you will probably want to encode the data in something like base64 (which is UTF-8 compatible).

    The binary payload type is sent directly. The bytes are sent as-is in the payload. This is more bandwidth efficient. It is means that you don’t have to do an encode/decode step. The bytes you send get sent directly, and the bytes you receive can be accessed directly with no decoding.

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

Sidebar

Related Questions

I'm making a little message sending module. It'll handle queuing messages from a request
I'm making a little vote system, in wich one can vote an answer, but
I'm in the process of making a little experiment, it grabs a YouTube page,
Im making my little site where users can create blogs, and have studied publishing
I am making a little program thath will read data from website. String in
While making a little Pong game in C++ OpenGL, I decided it'd be fun
I have been making a little toy web application in C# along the lines
I am making a little GUI frontend for a app at the moment using
I'm making a little vocabulary-quiz app, and the basic model for a word is
I'm making a little iphone game, and I would get some clues. Let's imagine:

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.