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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:27:14+00:00 2026-05-20T16:27:14+00:00

I have the contents of an http request in my buffer. I then define

  • 0

I have the contents of an http request in my buffer.
I then define another buffer of the same size as the last one.
And i need to copy the contents of the buffer to my new buffer.
So the help i need is that how do i get to copy one buffer to another buffer.

I tried memcpy but it is not working.

void TrivialMediaPlayer::DeliverMediaData(
        int                         streamId,
        bool                        bHasPriority,
        ConstBufferSptr             pMediaData)

What i want is to copy the contents of pMediaData to a new buffer.

BufferSptr buf1 (new Buffer (pMediaData->Size()) );

i want to copy pMediaData in buf1.

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-20T16:27:14+00:00Added an answer on May 20, 2026 at 4:27 pm

    I am not sure what the exact code you write to copy from one StringSptr from another.
    But if you wanna

    memcpy( (void*)buf1 , (void*)pMediaData , pMediaData.Size() );
    

    You must make sure that you should defined the “void*” function in the BufferSptr class (seems like a class written by you) to convert your BufferSptr object to a real C pointer which point to the address of internal buffer.
    Or, use some explicit call:

    memcpy( buf1.data() , pMediaData.data() , pMediaData.Size() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a piece of code VERY similar to this one http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailFetching I the
I have the following POST request: POST http://blah/Request HTTP/1.1 Host: blah Content-Length: 322 Proxy-Connection:
I have the following URLs with the same content: http://www.mysite.com/forum/viewthread.php?thread_id=39&pid=1349 http://www.mysite.com/forum/viewthread.php?forum_id=2&thread_id=39 Which at the
I am trying to log the contents of an http request, using an IHttpModule
I currrently have a SwingWorker that sends a HTTP Request and I override the
I have two pages, one sending a file_get_contents request: $postdata = http_build_query( array('install' =>
I am working on an Android application which does http request and download contents
I have a little program sends http request and gets response with TCP protocol.
I have a basic stream which is the stream of HTTP request and var
I have to upload my image using HTTP Post request. Image will be posted

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.