本文整理了Java中org.eclipse.jetty.io.Buffer.getIndex()
方法的一些代码示例,展示了Buffer.getIndex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.getIndex()
方法的具体详情如下:
包路径:org.eclipse.jetty.io.Buffer
类名称:Buffer
方法名:getIndex
[英]The index within the buffer that will next be read or written.
[中]缓冲区中下一个要读取或写入的索引。
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
*
*/
@Override
public void clear()
{
setMarkIndex(-1);
setGetIndex(0);
setPutIndex(_buffer.getIndex());
setGetIndex(_buffer.getIndex());
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
@Override
protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException
{
int headerPosition = header.getIndex();
int headerLength = header.length();
int bufferPosition = buffer.getIndex();
int written = super.gatheringFlush(header, bbuf0, buffer,bbuf1);
notifyOutgoing(header, headerPosition, written > headerLength ? headerLength : written);
notifyOutgoing(buffer, bufferPosition, written > headerLength ? written - headerLength : 0);
return written;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
/**
*
*/
@Override
public void clear()
{
setMarkIndex(-1);
setGetIndex(0);
setPutIndex(_buffer.getIndex());
setGetIndex(_buffer.getIndex());
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
@Override
protected int gatheringFlush(Buffer header, ByteBuffer bbuf0, Buffer buffer, ByteBuffer bbuf1) throws IOException
{
int headerPosition = header.getIndex();
int headerLength = header.length();
int bufferPosition = buffer.getIndex();
int written = super.gatheringFlush(header, bbuf0, buffer,bbuf1);
notifyOutgoing(header, headerPosition, written > headerLength ? headerLength : written);
notifyOutgoing(buffer, bufferPosition, written > headerLength ? written - headerLength : 0);
return written;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
@Override
public int flush(Buffer buffer) throws IOException
{
int position = buffer.getIndex();
int written = super.flush(buffer);
notifyOutgoing(buffer, position, written);
return written;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
@Override
public int flush(Buffer buffer) throws IOException
{
int position = buffer.getIndex();
int written = super.flush(buffer);
notifyOutgoing(buffer, position, written);
return written;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
/**
*
*/
@Override
public void clear()
{
setMarkIndex(-1);
setGetIndex(0);
setPutIndex(_buffer.getIndex());
setGetIndex(_buffer.getIndex());
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
@Override
public int flush(Buffer buffer) throws IOException
{
int position = buffer.getIndex();
int written = super.flush(buffer);
notifyOutgoing(buffer, position, written);
return written;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
@Override
public int flush(Buffer buffer) throws IOException
{
int position = buffer.getIndex();
int written = super.flush(buffer);
notifyOutgoing(buffer, position, written);
return written;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
public static boolean isPrefix(Buffer prefix,Buffer buffer)
{
if (prefix.length()>buffer.length())
return false;
int bi=buffer.getIndex();
for (int i=prefix.getIndex(); i<prefix.putIndex();i++)
if (prefix.peek(i)!=buffer.peek(bi++))
return false;
return true;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public static boolean isPrefix(Buffer prefix,Buffer buffer)
{
if (prefix.length()>buffer.length())
return false;
int bi=buffer.getIndex();
for (int i=prefix.getIndex(); i<prefix.putIndex();i++)
if (prefix.peek(i)!=buffer.peek(bi++))
return false;
return true;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
public static boolean isPrefix(Buffer prefix,Buffer buffer)
{
if (prefix.length()>buffer.length())
return false;
int bi=buffer.getIndex();
for (int i=prefix.getIndex(); i<prefix.putIndex();i++)
if (prefix.peek(i)!=buffer.peek(bi++))
return false;
return true;
}
代码示例来源: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-webapp
public InputStream getInputStream() throws IOException
{
Buffer indirect = getIndirectBuffer();
if (indirect!=null && indirect.array()!=null)
return new ByteArrayInputStream(indirect.array(),indirect.getIndex(),indirect.length());
return _resource.getInputStream();
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
public InputStream getInputStream() throws IOException
{
Buffer indirect = getIndirectBuffer();
if (indirect!=null && indirect.array()!=null)
return new ByteArrayInputStream(indirect.array(),indirect.getIndex(),indirect.length());
return _resource.getInputStream();
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public InputStream getInputStream() throws IOException
{
Buffer indirect = getIndirectBuffer();
if (indirect!=null && indirect.array()!=null)
return new ByteArrayInputStream(indirect.array(),indirect.getIndex(),indirect.length());
return _resource.getInputStream();
}
代码示例来源:origin: org.eclipse.jetty/server
public InputStream getInputStream() throws IOException
{
Buffer indirect = getIndirectBuffer();
if (indirect!=null && indirect.array()!=null)
return new ByteArrayInputStream(indirect.array(),indirect.getIndex(),indirect.length());
return _resource.getInputStream();
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public View(Buffer buffer)
{
super(READWRITE,!buffer.isImmutable());
_buffer=buffer.buffer();
setPutIndex(buffer.putIndex());
setGetIndex(buffer.getIndex());
setMarkIndex(buffer.markIndex());
_access=buffer.isReadOnly()?READONLY:READWRITE;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
public View(Buffer buffer)
{
super(READWRITE,!buffer.isImmutable());
_buffer=buffer.buffer();
setPutIndex(buffer.putIndex());
setGetIndex(buffer.getIndex());
setMarkIndex(buffer.markIndex());
_access=buffer.isReadOnly()?READONLY:READWRITE;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
public View(Buffer buffer)
{
super(READWRITE,!buffer.isImmutable());
_buffer=buffer.buffer();
setPutIndex(buffer.putIndex());
setGetIndex(buffer.getIndex());
setMarkIndex(buffer.markIndex());
_access=buffer.isReadOnly()?READONLY:READWRITE;
}
内容来源于网络,如有侵权,请联系作者删除!