本文整理了Java中org.littleshoot.mina.common.ByteBuffer.clear()
方法的一些代码示例,展示了ByteBuffer.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.clear()
方法的具体详情如下:
包路径:org.littleshoot.mina.common.ByteBuffer
类名称:ByteBuffer
方法名:clear
暂无
代码示例来源:origin: org.littleshoot/mina-port
public ByteBuffer clear() {
buf.clear();
return this;
}
代码示例来源:origin: org.littleshoot/mina-port
/**
* Clears this buffer and fills its content with <tt>value</tt>.
* The position is set to zero, the limit is set to the capacity,
* and the mark is discarded.
*/
public ByteBuffer sweep(byte value) {
clear();
return fillAndReset(value, remaining());
}
代码示例来源:origin: org.littleshoot/mina-port
/**
* Clears this buffer and fills its content with <tt>NUL</tt>.
* The position is set to zero, the limit is set to the capacity,
* and the mark is discarded.
*/
public ByteBuffer sweep() {
clear();
return fillAndReset(remaining());
}
代码示例来源:origin: org.littleshoot/mina-util
public void write(final ByteBuffer src)
{
m_log.debug("Writing data to input stream...");
m_rawBytesReceived += src.remaining();
m_log.debug("Received raw bytes: {}", m_rawBytesReceived);
synchronized (m_mutex)
{
if (m_closed)
{
m_log.debug("InputStream closed...");
return;
}
if (m_buf.hasRemaining())
{
m_log.debug("Copying buffer data...");
this.m_buf.compact();
this.m_buf.put(src);
this.m_buf.flip();
m_mutex.notifyAll();
}
else
{
m_log.debug("Nothing remaining in buffer...");
this.m_buf.clear();
this.m_buf.put(src);
this.m_buf.flip();
m_mutex.notifyAll();
}
}
}
代码示例来源:origin: org.littleshoot/mina-port
public void write(ByteBuffer src) {
synchronized (mutex) {
if (closed) {
return;
}
if (buf.hasRemaining()) {
this.buf.compact();
this.buf.put(src);
this.buf.flip();
} else {
this.buf.clear();
this.buf.put(src);
this.buf.flip();
mutex.notifyAll();
}
}
}
代码示例来源:origin: org.littleshoot/mina-port
public void append(ByteBuffer in) {
if (overflowPosition != 0) {
discard(in);
} else if (buf.position() > maxLineLength - in.remaining()) {
overflowPosition = buf.position();
buf.clear();
discard(in);
} else {
getBuffer().put(in);
}
}
代码示例来源:origin: org.littleshoot/mina-port
out.write(buf.getString(ctx.getDecoder()));
} finally {
buf.clear();
代码示例来源:origin: org.littleshoot/mina-port
out.write(buf.getString(ctx.getDecoder()));
} finally {
buf.clear();
代码示例来源:origin: org.littleshoot/sip-stack
buf.clear();
内容来源于网络,如有侵权,请联系作者删除!