Tabnine Logo
ByteBuffer.setAutoExpand
Code IndexAdd Tabnine to your IDE (free)

How to use
setAutoExpand
method
in
org.littleshoot.mina.common.ByteBuffer

Best Java code snippets using org.littleshoot.mina.common.ByteBuffer.setAutoExpand (Showing top 13 results out of 315)

origin: org.littleshoot/mina-port

public ByteBuffer setAutoExpand(boolean autoExpand) {
  buf.setAutoExpand(autoExpand);
  return this;
}
origin: org.littleshoot/sip-stack

private Context()
  {
  decoder = charset.newDecoder();
  buf = ByteBuffer.allocate(80).setAutoExpand(true);
  }
origin: org.littleshoot/mina-port

private Context() {
  decoder = charset.newDecoder();
  buf = ByteBuffer.allocate(80).setAutoExpand(true);
}
origin: org.littleshoot/mina-port

public IoSessionInputStream() {
  buf = ByteBuffer.allocate(16);
  buf.setAutoExpand(true);
  buf.limit(0);
}
origin: org.littleshoot/mina-util

public IoSessionInputStream(final IoSession ioSession, 
  final int readTimeout)
  {
  m_ioSession = ioSession;
  m_readTimeout = readTimeout;
  m_buf = ByteBuffer.allocate(16);
  m_buf.setAutoExpand(true);
  m_buf.limit(0);
  }
origin: org.littleshoot/sip-stack

public ByteBuffer encode(final SipMessage message)
  {
  final ByteBuffer buffer = ByteBuffer.allocate(300);
  buffer.setAutoExpand(true);
  
  final SipMessageVisitor visitor = new EncoderVisitor(buffer);
  message.accept(visitor);
  buffer.flip();
  
  return buffer;
  }
origin: org.littleshoot/mina-port

  public void encode(IoSession session, Object message,
      ProtocolEncoderOutput out) throws Exception {
    if (!(message instanceof Serializable)) {
      throw new NotSerializableException();
    }

    ByteBuffer buf = ByteBuffer.allocate(64);
    buf.setAutoExpand(true);
    buf.putObject(message);

    int objectSize = buf.position() - 4;
    if (objectSize > maxObjectSize) {
      buf.release();
      throw new IllegalArgumentException(
          "The encoded object is too big: " + objectSize + " (> "
              + maxObjectSize + ')');
    }

    buf.flip();
    out.write(buf);
  }
}
origin: org.littleshoot/mina-port

public void writeObject(Object obj) throws IOException {
  ByteBuffer buf = ByteBuffer.allocate(64, false);
  buf.setAutoExpand(true);
  buf.putObject(obj);
  int objectSize = buf.position() - 4;
  if (objectSize > maxObjectSize) {
    buf.release();
    throw new IllegalArgumentException(
        "The encoded object is too big: " + objectSize + " (> "
            + maxObjectSize + ')');
  }
  out.write(buf.array(), 0, buf.position());
  buf.release();
}
origin: org.littleshoot/mina-port

public void encode(IoSession session, Object message,
    ProtocolEncoderOutput out) throws Exception {
  CharsetEncoder encoder = (CharsetEncoder) session.getAttribute(ENCODER);
  if (encoder == null) {
    encoder = charset.newEncoder();
    session.setAttribute(ENCODER, encoder);
  }
  String value = message.toString();
  ByteBuffer buf = ByteBuffer.allocate(value.length())
      .setAutoExpand(true);
  buf.putString(value, encoder);
  if (buf.position() > maxLineLength) {
    throw new IllegalArgumentException("Line length: " + buf.position());
  }
  buf.putString(delimiter.getValue(), encoder);
  buf.flip();
  out.write(buf);
}
origin: org.littleshoot/mina-port

  private void storeRemainingInSession(ByteBuffer buf, IoSession session) {
    ByteBuffer remainingBuf = ByteBuffer.allocate(buf.capacity());
    remainingBuf.setAutoExpand(true);
    remainingBuf.order(buf.order());
    remainingBuf.put(buf);
    session.setAttribute(BUFFER, remainingBuf);
  }
}
origin: org.littleshoot/mina-util

m_buffer.setAutoExpand(true);
origin: org.littleshoot/mina-port

ByteBuffer tmp = ByteBuffer.allocate(2).setAutoExpand(true);
tmp.putString(delimiter.getValue(), charset.newEncoder());
tmp.flip();
origin: org.littleshoot/mina-util

m_buffer.setAutoExpand(true);
org.littleshoot.mina.commonByteBuffersetAutoExpand

Javadoc

Turns on or off autoExpand.

Popular methods of ByteBuffer

  • wrap
    Wraps the specified byte array into MINA heap buffer. Please note that MINA buffers are going to be
  • allocate
    Returns the buffer which is capable of the specified size.
  • flip
  • put
  • setAllocator
    Changes the current allocator with the specified one to manage the allocated buffers from now.
  • setUseDirectBuffers
  • get
  • hasRemaining
  • limit
  • position
  • remaining
  • capacity
    Changes the capacity of this buffer.
  • remaining,
  • capacity,
  • clear,
  • duplicate,
  • getString,
  • getUnsigned,
  • getUnsignedInt,
  • getUnsignedShort,
  • putString

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JFrame (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now