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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:48:37+00:00 2026-05-16T08:48:37+00:00

Now I have a database, which one field type is an array of byte.

  • 0

Now I have a database, which one field type is an array of byte.

Now I have a piece of memory, or an object. How to convert this piece of memory or even an object to a byte array and so that I can store the byte array to the database.

Suppose the object is

Foo foo

The memory is

buf         (actually, don't know how to declare it yet)

The database field is

byte data[256]

Only hex value like x'1' can be insert into the field.

Thanks so much!

  • 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-16T08:48:38+00:00Added an answer on May 16, 2026 at 8:48 am

    There are two methods.

    One is simple but has serious limitations. You can write the memory image of the Foo object. The drawback is that if you ever change the compiler or the structure of Foo then all your data may no longer loadable (because the image no longer matches the object). To do this simply use

    &Foo
    

    as the byte array.

    The other method is called ‘serialization‘. It can be used if the object changes
    but adds a lot of space to encode the information. If you only have 256 bytes then you
    need to be watchful serialization doesn’t create a string too large to save.

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

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Windows APIs aren't made available to the JScript runtime. You're… May 16, 2026 at 11:23 am
  • Editorial Team
    Editorial Team added an answer Although the given code doesn't compile, I assume you are… May 16, 2026 at 11:23 am
  • Editorial Team
    Editorial Team added an answer Your syntax should do. However, the following must go also:… May 16, 2026 at 11:23 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have integer type field in database which is having property Not Null. when
I have an in-memory table that might looks something like this: Favorite# Name Profession
I have the following problem: in a database table are Sales recorded. One of
I have stored various records in the MySql database orkut. Now I want to
I want to store a date value in a MySQL database. I have one
I have a database table called A and now i have create a new
I have a table in my database that represents datafields in a custom form.
I have a GridView that is bound to a DataTable, which in turn uses
I use a form where i have listed the data from database like title,
This is a contrived example, but consider a scenario where employees have working locations,

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.