org.eclipse.jetty.io.Buffer.skip()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.eclipse.jetty.io.Buffer.skip()方法的一些代码示例,展示了Buffer.skip()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.skip()方法的具体详情如下:
包路径:org.eclipse.jetty.io.Buffer
类名称:Buffer
方法名:skip

Buffer.skip介绍

[英]Skip _content. The getIndex is updated by min(remaining(), n)
[中]跳过内容。getIndex由min更新(剩余的(),n)

代码示例

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public static Buffer getString(Buffer _buffer, View tok)
{
  int len=((_buffer.peek()&0xFF)<<8)|(_buffer.peek(_buffer.getIndex()+1)&0xFF);
  if (len==0xffff)
  {
    _buffer.skip(2);
    return null;
  }
  int start=_buffer.getIndex();
  tok.update(start+2,start+len+2);
  _buffer.skip(len+3);
  return tok;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException
{
  int length;
  synchronized(this)
  {
    // Adjust position indexs of buf0 and buf1
    bbuf0=bbuf0.asReadOnlyBuffer();
    bbuf0.position(header.getIndex());
    bbuf0.limit(header.putIndex());
    bbuf1=bbuf1.asReadOnlyBuffer();
    bbuf1.position(buffer.getIndex());
    bbuf1.limit(buffer.putIndex());
    _gather2[0]=bbuf0;
    _gather2[1]=bbuf1;
    // do the gathering write.
    length=(int)((GatheringByteChannel)_channel).write(_gather2);
    int hl=header.length();
    if (length>hl)
    {
      header.clear();
      buffer.skip(length-hl);
    }
    else if (length>0)
    {
      header.skip(length);
    }
  }
  return length;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException
{
  int length;
  synchronized(this)
  {
    // Adjust position indexs of buf0 and buf1
    bbuf0=bbuf0.asReadOnlyBuffer();
    bbuf0.position(header.getIndex());
    bbuf0.limit(header.putIndex());
    bbuf1=bbuf1.asReadOnlyBuffer();
    bbuf1.position(buffer.getIndex());
    bbuf1.limit(buffer.putIndex());
    _gather2[0]=bbuf0;
    _gather2[1]=bbuf1;
    // do the gathering write.
    length=(int)((GatheringByteChannel)_channel).write(_gather2);
    int hl=header.length();
    if (length>hl)
    {
      header.clear();
      buffer.skip(length-hl);
    }
    else if (length>0)
    {
      header.skip(length);
    }
  }
  return length;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException
{
  int length;
  synchronized(this)
  {
    // Adjust position indexs of buf0 and buf1
    bbuf0=bbuf0.asReadOnlyBuffer();
    bbuf0.position(header.getIndex());
    bbuf0.limit(header.putIndex());
    bbuf1=bbuf1.asReadOnlyBuffer();
    bbuf1.position(buffer.getIndex());
    bbuf1.limit(buffer.putIndex());
    _gather2[0]=bbuf0;
    _gather2[1]=bbuf1;
    // do the gathering write.
    length=(int)((GatheringByteChannel)_channel).write(_gather2);
    int hl=header.length();
    if (length>hl)
    {
      header.clear();
      buffer.skip(length-hl);
    }
    else if (length>0)
    {
      header.skip(length);
    }
  }
  return length;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException
{
  int length;
  synchronized(this)
  {
    // Adjust position indexs of buf0 and buf1
    bbuf0=bbuf0.asReadOnlyBuffer();
    bbuf0.position(header.getIndex());
    bbuf0.limit(header.putIndex());
    bbuf1=bbuf1.asReadOnlyBuffer();
    bbuf1.position(buffer.getIndex());
    bbuf1.limit(buffer.putIndex());
    _gather2[0]=bbuf0;
    _gather2[1]=bbuf1;
    // do the gathering write.
    length=(int)((GatheringByteChannel)_channel).write(_gather2);
    int hl=header.length();
    if (length>hl)
    {
      header.clear();
      buffer.skip(length-hl);
    }
    else if (length>0)
    {
      header.skip(length);
    }
  }
  return length;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public static Buffer getHeaderName(Buffer _buffer, View tok)
{
  int len=((_buffer.peek()&0xFF)<<8)|(_buffer.peek(_buffer.getIndex()+1)&0xFF);
  if ((0xFF00&len)==0xA000)
  {
    _buffer.skip(1);
    return Ajp13RequestHeaders.CACHE.get(_buffer.get());
  }
  int start=_buffer.getIndex();
  tok.update(start+2,start+len+2);
  _buffer.skip(len+3);
  return tok;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

buffer.skip(len);
  buffer.skip(len);
len=_channel.write(b);
if (len>0)
  buffer.skip(len);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

buffer.skip(len);
  buffer.skip(len);
len=_channel.write(b);
if (len>0)
  buffer.skip(len);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

buffer.skip(len);
  buffer.skip(len);
len=_channel.write(b);
if (len>0)
  buffer.skip(len);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

buffer.skip(len);
  buffer.skip(len);
len=_channel.write(b);
if (len>0)
  buffer.skip(len);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

_content.skip(len);
  _content.skip(_buffer.put(_content));
LOG.debug("flushBuffer {} of {}",len,size);
if (len>0)
  _buffer.skip(len);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public int flush(Buffer buffer) throws IOException
{
  if (_closed)
    throw new IOException("CLOSED");
  if (_growOutput && buffer.length()>_out.space())
  {
    _out.compact();
    if (buffer.length()>_out.space())
    {
      ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length());
      n.put(_out.peek(0,_out.putIndex()));
      if (_out.getIndex()>0)
      {
        n.mark();
        n.setGetIndex(_out.getIndex());
      }
      _out=n;
    }
  }
  int len = _out.put(buffer);
  if (!buffer.isImmutable())
    buffer.skip(len);
  return len;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public int flush(Buffer buffer) throws IOException
{
  if (_closed)
    throw new IOException("CLOSED");
  if (_growOutput && buffer.length()>_out.space())
  {
    _out.compact();
    if (buffer.length()>_out.space())
    {
      ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length());
      n.put(_out.peek(0,_out.putIndex()));
      if (_out.getIndex()>0)
      {
        n.mark();
        n.setGetIndex(_out.getIndex());
      }
      _out=n;
    }
  }
  int len = _out.put(buffer);
  if (!buffer.isImmutable())
    buffer.skip(len);
  return len;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public int flush(Buffer buffer) throws IOException
{
  if (_closed)
    throw new IOException("CLOSED");
  if (_growOutput && buffer.length()>_out.space())
  {
    _out.compact();
    if (buffer.length()>_out.space())
    {
      ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length());
      n.put(_out.peek(0,_out.putIndex()));
      if (_out.getIndex()>0)
      {
        n.mark();
        n.setGetIndex(_out.getIndex());
      }
      _out=n;
    }
  }
  int len = _out.put(buffer);
  if (!buffer.isImmutable())
    buffer.skip(len);
  return len;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public int flush(Buffer buffer) throws IOException
{
  if (_closed)
    throw new IOException("CLOSED");
  if (_growOutput && buffer.length()>_out.space())
  {
    _out.compact();
    if (buffer.length()>_out.space())
    {
      ByteArrayBuffer n = new ByteArrayBuffer(_out.putIndex()+buffer.length());
      n.put(_out.peek(0,_out.putIndex()));
      if (_out.getIndex()>0)
      {
        n.mark();
        n.setGetIndex(_out.getIndex());
      }
      _out=n;
    }
  }
  int len = _out.put(buffer);
  if (!buffer.isImmutable())
    buffer.skip(len);
  return len;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

take=_body.length();
_body.peek(_body.getIndex(),take);
_body.skip(_header.put(_body.peek(_body.getIndex(),take)));

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

take=_body.length();
_body.peek(_body.getIndex(),take);
_body.skip(_header.put(_body.peek(_body.getIndex(),take)));

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

take=_body.length();
_body.peek(_body.getIndex(),take);
_body.skip(_header.put(_body.peek(_body.getIndex(),take)));

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

take=_body.length();
_body.peek(_body.getIndex(),take);
_body.skip(_header.put(_body.peek(_body.getIndex(),take)));

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

take=_body.length();
_body.peek(_body.getIndex(),take);
_body.skip(_header.put(_body.peek(_body.getIndex(),take)));

相关文章