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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:57:42+00:00 2026-05-15T14:57:42+00:00

Should be an easy one. I’m working on Scala trying to handle long sequences

  • 0

Should be an easy one.

I’m working on Scala trying to handle long sequences of binary data. That is long lists of 0’s and 1’s. What is the ‘best’ way to store/access this kind of data.

The important point here is memory optimisation, so I would like to avoid using an entire byte to store a boolean. Also access is somwhat important, so I would like to avoid paking them into bytes and then into arrays.

Is a BitMap a good idea? Is there such a class in scala?

if not, would it be best to use ByteArray? How would you implement this?

Any other ideas?

Thanks,

  • 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-15T14:57:42+00:00Added an answer on May 15, 2026 at 2:57 pm

    You can use java.util.BitSet (perhaps with a couple if clever explicits to make it more Scala-like).

    If that is still too costly I would write a class that uses an array internally and pack the bits into ints or bytes.

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

Sidebar

Related Questions

This should be easy one, I just haven't found any reference to that.
This should be any easy one for you. I have an accordion that I'd
This should be an easy one. I have a variable that I've already declared
This should be an easy one: I am creating a program that spawns a
This should be an easy one. How to write a jquery function that gets
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
The one-liner should: solve a real-world problem not be extensively cryptic (should be easy
This should be easy, but I'm not sure how to best go about it.
I am struggling on something that, I am sure, should be easy. I have
Should be an easy one. What is the value of the AltGr key in

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.