org.glassfish.grizzly.Buffer.tryDispose()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(131)

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

Buffer.tryDispose介绍

[英]Try to dispose Buffer if it's allowed.
[中]如果允许,尝试处置缓冲区。

代码示例

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * {@inheritDoc}
 */
@Override
public void release(final Buffer buffer) {
  buffer.tryDispose();
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void release(final Buffer buffer) {
  buffer.tryDispose();
}

代码示例来源:origin: javaee/grizzly

@Override
  public void release() {
    if (!isClosed) {
      isClosed = true;
      buffer.tryDispose();
    }
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  public void release() {
    if (!isClosed) {
      isClosed = true;
      buffer.tryDispose();
    }
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-core

/**
 * {@inheritDoc}
 */
@Override
public void release(final Buffer buffer) {
  buffer.tryDispose();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * {@inheritDoc}
 */
@Override
public void release(final Buffer buffer) {
  buffer.tryDispose();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

@Override
  public void release() {
    if (!isClosed) {
      isClosed = true;
      buffer.tryDispose();
    }
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  public void release() {
    if (!isClosed) {
      isClosed = true;
      buffer.tryDispose();
    }
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void release(final Buffer buffer) {
  buffer.tryDispose();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

static Buffer move(final MemoryManager memoryManager,
    final Buffer buffer) {
  final Buffer tmpBuf = copy(memoryManager, buffer);
  buffer.tryDispose();
  return tmpBuf;
}

代码示例来源:origin: javaee/grizzly

static Buffer move(final MemoryManager memoryManager,
    final Buffer buffer) {
  final Buffer tmpBuf = copy(memoryManager, buffer);
  buffer.tryDispose();
  return tmpBuf;
}

代码示例来源:origin: javaee/grizzly

static Buffer move(final MemoryManager memoryManager,
    final Buffer buffer) {
  final Buffer tmpBuf = copy(memoryManager, buffer);
  buffer.tryDispose();
  return tmpBuf;
}

代码示例来源:origin: javaee/grizzly

static Buffer move(final MemoryManager memoryManager,
    final Buffer buffer) {
  final Buffer tmpBuf = copy(memoryManager, buffer);
  buffer.tryDispose();
  return tmpBuf;
}

代码示例来源:origin: javaee/grizzly

@SuppressWarnings("MethodMayBeStatic")
protected Buffer wrapAll(final FilterChainContext ctx,
             final SSLConnectionContext sslCtx) throws SSLException {
  
  final Buffer input = ctx.getMessage();
  
  final Buffer output = sslCtx.wrapAll(input, OUTPUT_BUFFER_ALLOCATOR);
  input.tryDispose();
  return output;
}

代码示例来源:origin: javaee/grizzly

@SuppressWarnings("MethodMayBeStatic")
protected Buffer wrapAll(final FilterChainContext ctx,
             final SSLConnectionContext sslCtx) throws SSLException {
  
  final Buffer input = ctx.getMessage();
  
  final Buffer output = sslCtx.wrapAll(input, OUTPUT_BUFFER_ALLOCATOR);
  input.tryDispose();
  return output;
}

代码示例来源:origin: javaee/grizzly

public void decode(final DecodingCallback callback) {
  if (inBuffer != null) {
    hpackDecoder.decode(inBuffer, !isProcessingHeaders(), callback);
    
    inBuffer.tryDispose();
    inBuffer = null;
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

public void decode(final DecodingCallback callback) {
  if (inBuffer != null) {
    hpackDecoder.decode(inBuffer, !isProcessingHeaders(), callback);
    
    inBuffer.tryDispose();
    inBuffer = null;
  }
}

代码示例来源:origin: javaee/grizzly

protected void updateInputContentBuffer(final Buffer buffer)  {
  buffer.allowBufferDispose(true);
  
  if (inputContentBuffer == null) {
    inputContentBuffer = buffer;
  } else if (inputContentBuffer.hasRemaining()
      || readAheadLimit > 0) { // if the stream is marked - we can't dispose the inputContentBuffer, even if it's been read off
    toCompositeInputContentBuffer().append(buffer);
  } else {
    inputContentBuffer.tryDispose();
    inputContentBuffer = buffer;
  }
}

代码示例来源:origin: javaee/grizzly

protected void updateInputContentBuffer(final Buffer buffer)  {
  buffer.allowBufferDispose(true);
  
  if (inputContentBuffer == null) {
    inputContentBuffer = buffer;
  } else if (inputContentBuffer.hasRemaining()
      || readAheadLimit > 0) { // if the stream is marked - we can't dispose the inputContentBuffer, even if it's been read off
    toCompositeInputContentBuffer().append(buffer);
  } else {
    inputContentBuffer.tryDispose();
    inputContentBuffer = buffer;
  }
}

代码示例来源:origin: javaee/grizzly

protected void updateInputContentBuffer(final Buffer buffer)  {
  buffer.allowBufferDispose(true);
  
  if (inputContentBuffer == null) {
    inputContentBuffer = buffer;
  } else if (inputContentBuffer.hasRemaining()
      || readAheadLimit > 0) { // if the stream is marked - we can't dispose the inputContentBuffer, even if it's been read off
    toCompositeInputContentBuffer().append(buffer);
  } else {
    inputContentBuffer.tryDispose();
    inputContentBuffer = buffer;
  }
}

相关文章