public ByteBuffer compact() { buf.compact(); return this; }
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(); } } }
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(); } } }
buf.compact(); else storeRemainingInSession(buf, session);