Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetty-12 javadoc on Stream.Listener.onDataAvailable(Stream) is wrong #9190

Closed
janbartel opened this issue Jan 18, 2023 · 1 comment
Closed
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@janbartel
Copy link
Contributor

jetty-12.0.x

Javadoc from org.eclipse.jetty.http.api.Stream.Listener.onDataAvailable(Stream) says:

      class MyStreamListener implements Stream.Listener
      {
          @Override
          public void onDataAvailable(Stream stream)
          {
              // Read a chunk of the content.
              Stream.Data data = stream.readData();
              if (data == null)
              {
                  // No data available now, demand to be called back.
                  stream.demand();
              }
              else
              {
                  // Process the content.
                  process(data.getByteBuffer());
                  // Notify that the content has been consumed.
                  data.release();
                  if (!data.frame().isEndStream())
                  {
                      // Demand to be called back.
                      stream.demand();
                  }
              }
          }
      }

However there is no such method Stream.Data.getByteBuffer().

@janbartel janbartel added the Bug For general bugs on Jetty side label Jan 18, 2023
@sbordet
Copy link
Contributor

sbordet commented Jan 23, 2023

Fixing this in #9195.

@sbordet sbordet closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

2 participants