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

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

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

Buffer.asArray介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.jetty/test-jetty-servlet

private String getString(Buffer buffer)
{
  return getString(buffer.asArray());
}

代码示例来源:origin: org.eclipse.jetty/jetty-servlet-tester

private String getString(Buffer buffer)
{
  return getString(buffer.asArray());
}

代码示例来源:origin: org.eclipse.jetty/test-jetty-servlet

@Override
public void content(Buffer ref) throws IOException
{
  if (_parsedContent==null)
    _parsedContent=new ByteArrayOutputStream2();
  _parsedContent.write(ref.asArray());
}

代码示例来源:origin: org.eclipse.jetty/jetty-servlet-tester

public void content(Buffer ref) throws IOException
  {
    if (_parsedContent==null)
      _parsedContent=new ByteArrayOutputStream2();
    _parsedContent.write(ref.asArray());
  }
}

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

public Buffer lookup(Buffer buffer)
{
  if (buffer instanceof CachedBuffer)
    return buffer;
  
  Buffer b= get(buffer);
  if (b == null)
  {
    if (buffer instanceof Buffer.CaseInsensitve)
      return buffer;
    return new ByteArrayBuffer.CaseInsensitive(buffer.asArray(),0,buffer.length(),Buffer.IMMUTABLE);
  }
  return b;
}

代码示例来源:origin: org.sonatype.nexus/nexus-indexer

targetChannel.write( ByteBuffer.wrap( content.asArray() ) );
listenerSupport.fireTransferProgress( transferEvent, content.asArray(), contentLength );

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

public Buffer lookup(Buffer buffer)
{
  if (buffer instanceof CachedBuffer)
    return buffer;
  
  Buffer b= get(buffer);
  if (b == null)
  {
    if (buffer instanceof Buffer.CaseInsensitve)
      return buffer;
    return new ByteArrayBuffer.CaseInsensitive(buffer.asArray(),0,buffer.length(),Buffer.IMMUTABLE);
  }
  return b;
}

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

public Buffer lookup(Buffer buffer)
{
  if (buffer instanceof CachedBuffer)
    return buffer;
  
  Buffer b= get(buffer);
  if (b == null)
  {
    if (buffer instanceof Buffer.CaseInsensitve)
      return buffer;
    return new ByteArrayBuffer.CaseInsensitive(buffer.asArray(),0,buffer.length(),Buffer.IMMUTABLE);
  }
  return b;
}

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

public Buffer lookup(Buffer buffer)
{
  if (buffer instanceof CachedBuffer)
    return buffer;
  
  Buffer b= get(buffer);
  if (b == null)
  {
    if (buffer instanceof Buffer.CaseInsensitve)
      return buffer;
    return new ByteArrayBuffer.CaseInsensitive(buffer.asArray(),0,buffer.length(),Buffer.IMMUTABLE);
  }
  return b;
}

代码示例来源:origin: org.eclipse.jetty.spdy/spdy-jetty-http

private DataInfo toDataInfo(Buffer buffer, boolean close)
{
  if (buffer instanceof ByteArrayBuffer)
    return new BytesDataInfo(buffer.array(), buffer.getIndex(), buffer.length(), close);
  if (buffer instanceof NIOBuffer)
  {
    ByteBuffer byteBuffer = ((NIOBuffer)buffer).getByteBuffer();
    byteBuffer.limit(buffer.putIndex());
    byteBuffer.position(buffer.getIndex());
    return new ByteBufferDataInfo(byteBuffer, close);
  }
  return new BytesDataInfo(buffer.asArray(), close);
}

代码示例来源:origin: org.eclipse.jetty.spdy/spdy-jetty-http

private DataInfo toDataInfo(Buffer buffer, boolean close)
{
  if (buffer instanceof ByteArrayBuffer)
    return new BytesDataInfo(buffer.array(), buffer.getIndex(), buffer.length(), close);
  if (buffer instanceof NIOBuffer)
  {
    ByteBuffer byteBuffer = ((NIOBuffer)buffer).getByteBuffer();
    byteBuffer.limit(buffer.putIndex());
    byteBuffer.position(buffer.getIndex());
    return new ByteBufferDataInfo(byteBuffer, close);
  }
  return new BytesDataInfo(buffer.asArray(), close);
}

相关文章