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

The Archive Base Latest Questions

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

I am looking for a way to add a serialized value of an object

  • 0

I am looking for a way to add a serialized value of an object (byte[]) to a repeated field in a protocol buffers message.

I have an application that keeps data items in serialized form in memcached and needs to deliver them to remote clients. The client requests data items by providing a list of keys and the server sends back the list of data items. The content of data items is not important for the server; it does not need to know what is contained in them, it only needs to know their key.

The current approach is to fetch items from memcached, deserialize them, add them to the list of data items in a response, serialize the response into a byte array and send it over a socket. This is not optimal, because we deserialize data items only to have them serialized again in the next step. Both serializations (for memcached and for output) are done with protocol buffers. Ideally, we could skip the deserialization after fetching the data from memcached and add the serialized values to the response. I looked into both protobuf-net and protobuf-csharp and did not find a way to accomplish this. Is it possible? Did I overlook something?

Here are proto definitions (simplified):

message Request {    
    required int32 messageId;
    repeated string keys;
}

message DataItem {

    required string key = 1;
    required ValueType type = 2;      // the type of the value, enumeration

    optional int32 intValue = 3;
    optional int64 longValue = 4;
    optional double doubleValue = 5;
    optional float floatValue = 6;
    optional bool boolValue = 7;
    optional string stringValue = 8;
}

message Response {
    required int32 messageId;
    repeated DataItem dataItems;
}
  • 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:04:30+00:00Added an answer on May 16, 2026 at 8:04 am

    Well, the bytes field type represents opaque binary data… is that what you’re looking for? Note that for immutability purposes (in protobuf-csharp anyway) these are represented as immutable ByteString values – but you’ll be able to copy those from one message to another without the actual data being copied (i.e. keep a single reference to the same blob in two messages).

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

Sidebar

Related Questions

I'm looking for a way to add a value to price of configurable product
I´m looking a way to add my app in select an action menu that
I'm looking for a way to add a javascript object to the DOM without
I'm looking for a way to store a serialized value of eg. IDs in
I'm looking for a way to add a value to a parameter whose available
I have been looking for a way to add the information (string) from a
I'm looking for the best/easiest way to add extensions to an existing protocol (can't
I was looking for a way to add new elements to an an existing
I'm looking for a way to add an EventListener which will automatically removes itself
All, I am looking for a way to add an OCS presence icon the

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.