Tabnine Logo
IoBuffer.isDirect
Code IndexAdd Tabnine to your IDE (free)

How to use
isDirect
method
in
org.apache.mina.codec.IoBuffer

Best Java code snippets using org.apache.mina.codec.IoBuffer.isDirect (Showing top 5 results out of 315)

origin: apache/mina

/**
 * Extends the current IoBuffer capacity.
 * 
 * @param size
 *            the number of bytes to extend the current IoBuffer
 * @return the current {@link IoBuffer}
 */
public IoBuffer extend(int size) {
  ByteBuffer extension = isDirect() ? ByteBuffer.allocateDirect(size) : ByteBuffer.allocate(size);
  add(extension);
  return this;
}
origin: apache/mina

/**
 * Test the allocation of a new direct IoBuffer with no byte in it
 */
@Test
public void testAllocateDirect0() {
  IoBuffer ioBuffer = IoBuffer.allocateDirect(0);
  assertTrue(ioBuffer.isDirect());
  assertEquals(0, ioBuffer.capacity());
  assertEquals(0, ioBuffer.limit());
  assertEquals(0, ioBuffer.position());
  assertFalse(ioBuffer.hasRemaining());
}
origin: apache/mina

/**
 * Test the allocation of a new heap IoBuffer with no byte in it
 */
@Test
public void testAllocate0() {
  IoBuffer ioBuffer = IoBuffer.allocate(0);
  assertFalse(ioBuffer.isDirect());
  assertEquals(0, ioBuffer.capacity());
  assertEquals(0, ioBuffer.limit());
  assertEquals(0, ioBuffer.position());
  assertFalse(ioBuffer.hasRemaining());
}
origin: apache/mina

/**
 * Test the allocation of a new direct IoBuffer with 1024 bytes
 */
@Test
public void testAllocateDirect1024() {
  IoBuffer ioBuffer = IoBuffer.allocateDirect(1024);
  assertTrue(ioBuffer.isDirect());
  assertEquals(1024, ioBuffer.capacity());
  assertEquals(1024, ioBuffer.limit());
  assertEquals(0, ioBuffer.position());
  assertTrue(ioBuffer.hasRemaining());
}
origin: apache/mina

/**
 * Test the allocation of a new heap IoBuffer with 1024 bytes
 */
@Test
public void testAllocate1024() {
  IoBuffer ioBuffer = IoBuffer.allocate(1024);
  assertFalse(ioBuffer.isDirect());
  assertEquals(1024, ioBuffer.capacity());
  assertEquals(1024, ioBuffer.limit());
  assertEquals(0, ioBuffer.position());
  assertTrue(ioBuffer.hasRemaining());
}
org.apache.mina.codecIoBufferisDirect

Popular methods of IoBuffer

  • asInputStream
    Provides an input stream which is actually reading the IoBufferinstance. Further reads on the return
  • get
  • remaining
  • add
    Add one or more ByteBuffer to the current IoBuffer
  • array
  • capacity
  • getChar
  • getDouble
  • getFloat
  • getInt
  • getLong
  • getShort
  • getLong,
  • getShort,
  • hasRemaining,
  • limit,
  • order,
  • position,
  • put,
  • putChar,
  • putDouble

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JComboBox (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
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