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

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

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

Buffer.isComposite介绍

暂无

代码示例

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

private static Buffer allowDispose(final Buffer buffer) {
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static Buffer allowDispose(final Buffer buffer) {
  if (buffer == null) {
    return null;
  }
  
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static int readBuffer(final TCPNIOConnection connection,
               final Buffer buffer) throws IOException {
  return buffer.isComposite()
      ? readCompositeBuffer(connection, (CompositeBuffer) buffer)
      : readSimpleBuffer(connection, buffer);
}

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

public static Buffer allowDispose(final Buffer buffer) {
  if (buffer == null) {
    return null;
  }
  
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static Buffer allowDispose(final Buffer buffer) {
  if (buffer == null) {
    return null;
  }
  
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

private static Buffer allowDispose(final Buffer buffer) {
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static Buffer allowDispose(final Buffer buffer) {
  if (buffer == null) {
    return null;
  }
  
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static int readBuffer(final TCPNIOConnection connection,
               final Buffer buffer) throws IOException {
  return buffer.isComposite()
      ? readCompositeBuffer(connection, (CompositeBuffer) buffer)
      : readSimpleBuffer(connection, buffer);
}

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

public static int readBuffer(final TCPNIOConnection connection,
               final Buffer buffer) throws IOException {
  return buffer.isComposite()
      ? readCompositeBuffer(connection, (CompositeBuffer) buffer)
      : readSimpleBuffer(connection, buffer);
}

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

public static Buffer allowDispose(final Buffer buffer) {
  if (buffer == null) {
    return null;
  }
  
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

private static Buffer allowDispose(final Buffer buffer) {
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

private static Buffer allowDispose(final Buffer buffer) {
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static Buffer allowDispose(final Buffer buffer) {
  if (buffer == null) {
    return null;
  }
  
  buffer.allowBufferDispose(true);
  if (buffer.isComposite()) {
    ((CompositeBuffer) buffer).allowInternalBuffersDispose(true);
  }
  
  return buffer;
}

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

public static int readBuffer(final TCPNIOConnection connection,
               final Buffer buffer) throws IOException {
  return buffer.isComposite()
      ? readCompositeBuffer(connection, (CompositeBuffer) buffer)
      : readSimpleBuffer(connection, buffer);
}

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

private static void disposeBuffers(final Buffer currentBuffer, final Buffer bigBuffer) {
  if (currentBuffer != null) {
    currentBuffer.dispose();
  }
  if (bigBuffer != null) {
    bigBuffer.allowBufferDispose(true);
    if (bigBuffer.isComposite()) {
      ((CompositeBuffer) bigBuffer).allowInternalBuffersDispose(true);
    }
    
    bigBuffer.dispose();
  }
}

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

private static void disposeBuffers(final Buffer currentBuffer, final Buffer bigBuffer) {
  if (currentBuffer != null) {
    currentBuffer.dispose();
  }
  if (bigBuffer != null) {
    bigBuffer.allowBufferDispose(true);
    if (bigBuffer.isComposite()) {
      ((CompositeBuffer) bigBuffer).allowInternalBuffersDispose(true);
    }
    
    bigBuffer.dispose();
  }
}

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

private static void disposeBuffers(final Buffer currentBuffer, final Buffer bigBuffer) {
  if (currentBuffer != null) {
    currentBuffer.dispose();
  }
  if (bigBuffer != null) {
    bigBuffer.allowBufferDispose(true);
    if (bigBuffer.isComposite()) {
      ((CompositeBuffer) bigBuffer).allowInternalBuffersDispose(true);
    }
    
    bigBuffer.dispose();
  }
}

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

private static void disposeBuffers(final Buffer currentBuffer, final Buffer bigBuffer) {
  if (currentBuffer != null) {
    currentBuffer.dispose();
  }
  if (bigBuffer != null) {
    bigBuffer.allowBufferDispose(true);
    if (bigBuffer.isComposite()) {
      ((CompositeBuffer) bigBuffer).allowInternalBuffersDispose(true);
    }
    
    bigBuffer.dispose();
  }
}

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

private static void disposeBuffers(final Buffer currentBuffer, final Buffer bigBuffer) {
  if (currentBuffer != null) {
    currentBuffer.dispose();
  }
  if (bigBuffer != null) {
    bigBuffer.allowBufferDispose(true);
    if (bigBuffer.isComposite()) {
      ((CompositeBuffer) bigBuffer).allowInternalBuffersDispose(true);
    }
    
    bigBuffer.dispose();
  }
}

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

@Override
  public NextAction handleRead(FilterChainContext ctx) throws IOException {
    Buffer b = ctx.getMessage();
    
    if (!part1Future.isDone()) {
      part1Future.result(b.allowBufferDispose());
    } else if (!part2Future.isDone()) {
      part2Future.result(b.isComposite() && b.allowBufferDispose());
    }
    
    return ctx.getStopAction(b);
  }
}

相关文章