本文整理了Java中org.eclipse.jetty.io.Buffer.compact()
方法的一些代码示例,展示了Buffer.compact()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.compact()
方法的具体详情如下:
包路径:org.eclipse.jetty.io.Buffer
类名称:Buffer
方法名:compact
[英]Compact the buffer by discarding bytes before the postion (or mark if set). Bytes from the getIndex (or mark) to the putIndex are moved to the beginning of the buffer and the values adjusted accordingly.
[中]通过在位置之前丢弃字节(或标记,如果设置)来压缩缓冲区。从getIndex(或mark)到putIndex的字节移动到缓冲区的开头,并相应地调整值。
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
private synchronized int expelBuffer(long blockFor) throws IOException
{
if (_buffer==null)
return 0;
int result = flushBuffer();
_buffer.compact();
if (!_endp.isBlocking())
{
while (_buffer.space()==0)
{
boolean ready = _endp.blockWritable(blockFor);
if (!ready)
throw new IOException("Write timeout");
result += flushBuffer();
_buffer.compact();
}
}
return result;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
private synchronized int expelBuffer(long blockFor) throws IOException
{
if (_buffer==null)
return 0;
int result = flushBuffer();
_buffer.compact();
if (!_endp.isBlocking())
{
while (_buffer.space()==0)
{
boolean ready = _endp.blockWritable(blockFor);
if (!ready)
throw new IOException("Write timeout");
result += flushBuffer();
_buffer.compact();
}
}
return result;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
private synchronized int expelBuffer(long blockFor) throws IOException
{
if (_buffer==null)
return 0;
int result = flushBuffer();
_buffer.compact();
if (!_endp.isBlocking())
{
while (_buffer.space()==0)
{
boolean ready = _endp.blockWritable(blockFor);
if (!ready)
throw new IOException("Write timeout");
result += flushBuffer();
_buffer.compact();
}
}
return result;
}
代码示例来源:origin: org.eclipse.jetty/jetty-websocket
private synchronized int expelBuffer(long blockFor) throws IOException
{
if (_buffer==null)
return 0;
int result = flushBuffer();
_buffer.compact();
if (!_endp.isBlocking())
{
while (_buffer.space()==0)
{
boolean ready = _endp.blockWritable(blockFor);
if (!ready)
throw new IOException("Write timeout");
result += flushBuffer();
_buffer.compact();
}
}
return result;
}
代码示例来源:origin: org.eclipse.jetty/jetty-websocket
private synchronized int expelBuffer(long blockFor) throws IOException
{
if (_buffer==null)
return 0;
int result = flushBuffer();
_buffer.compact();
if (!_endp.isBlocking())
{
while (_buffer.space()==0)
{
boolean ready = _endp.blockWritable(blockFor);
if (!ready)
throw new IOException("Write timeout");
result += flushBuffer();
_buffer.compact();
}
}
return result;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
private synchronized int expelBuffer(long blockFor) throws IOException
{
if (_buffer==null)
return 0;
int result = flushBuffer();
_buffer.compact();
if (!_endp.isBlocking())
{
while (_buffer.space()==0)
{
boolean ready = _endp.blockWritable(blockFor);
if (!ready)
throw new IOException("Write timeout");
result += flushBuffer();
_buffer.compact();
}
}
return result;
}
代码示例来源:origin: org.eclipse.jetty/jetty-websocket
_buffer.compact();
return result;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
_buffer.compact();
return result;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
_buffer.compact();
return result;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
_buffer.compact();
return result;
代码示例来源:origin: org.eclipse.jetty/jetty-websocket
_buffer.compact();
return result;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
_buffer.compact();
return result;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
public boolean isBufferFull()
{
if (_buffer != null && _buffer.space()==0)
{
if (_buffer.length()==0 && !_buffer.isImmutable())
_buffer.compact();
return _buffer.space()==0;
}
return _content!=null && _content.length()>0;
}
代码示例来源:origin: org.eclipse.jetty/http
public boolean isBufferFull()
{
if (_buffer != null && _buffer.space()==0)
{
if (_buffer.length()==0 && !_buffer.isImmutable())
_buffer.compact();
return _buffer.space()==0;
}
return _content!=null && _content.length()>0;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public boolean isBufferFull()
{
if (_buffer != null && _buffer.space()==0)
{
if (_buffer.length()==0 && !_buffer.isImmutable())
_buffer.compact();
return _buffer.space()==0;
}
return _content!=null && _content.length()>0;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
public boolean isBufferFull()
{
if (_buffer != null && _buffer.space()==0)
{
if (_buffer.length()==0 && !_buffer.isImmutable())
_buffer.compact();
return _buffer.space()==0;
}
return _content!=null && _content.length()>0;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
public boolean isBufferFull()
{
if (_buffer != null && _buffer.space()==0)
{
if (_buffer.length()==0 && !_buffer.isImmutable())
_buffer.compact();
return _buffer.space()==0;
}
return _content!=null && _content.length()>0;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
buffer.compact();
return length;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
buffer.compact();
return length;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
_header.compact();
_header.compact();
内容来源于网络,如有侵权,请联系作者删除!