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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:48:48+00:00 2026-06-05T10:48:48+00:00

I am running into problems coding the FrameDecoder.decode() for a tcp netty client. protected

  • 0

I am running into problems coding the FrameDecoder.decode() for a tcp netty client.

protected Object decode(ChannelHandlerContext ctx, Channel channel,
        ChannelBuffer buffer) throws Exception {

In the above signature , the buffer is supposed to contain the bytes that need to be framed. But then why does an obejct have to be returned ? I am aware that if the returned object is null , this indicates that more data is required into this buffer, but what happens if I return a buffer with some unread bytes of a partial frame in it ? Will this be invoked with the more bytes added ?

Lets say a given invocation of decode() has a buffer with 100 bytes in it. Out of this 100 , there are 2 full frames of 25 and 55 bytes and partial frame of 20 bytes. Can I just read the first full frame ( of 25 bytes ) and return the buffer ( with 75 bytes in it – 1 full frame of 55 bytes and another 20 bytes of a partial frame ) ? Will this cause any bytes to be overwritten the next time decode is invoked ? or will it be ok for me to read the next frame ( of 55 bytes ) in the next invocation ?

  • 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-06-05T10:48:50+00:00Added an answer on June 5, 2026 at 10:48 am

    You will return one frame per each call of decode. The FrameDecoder will continue to read and forward the read frames until you return null. The bytes left in the FrameDecoder will get saved and once a new ChannelBuffer was received both will get merged and the FrameDecoders decode(..) method will get called again.

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

Sidebar

Related Questions

I'm running into problems implementing statuses for a model. This is probably due to
I am running into problems where some of our data stores are seeing a
I'm running into problems with my Sieve of Eratosthenes. I wanted to write a
Hi guys I'm trying to integrate the tinymce plugin however I'm running into problems
I'm using MATLAB to access a postgresql database. I'm running into problems trying to
I'm running into some problems using my .NET 4.0 libraries in .NET 2.0 applications.
I have been trying to learn Erlang and have been running into some problems
I'm currently working on an embedded device project where I'm running into performance problems.
I'm attempting to follow Heroku's python quickstart guide but am running into repeated problems.
I am running into lots of problems with Unicode at the moment. As I

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.