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

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

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

origin: apache/mina

/**
 * @see ByteBuffer#getFloat()
 */
public float getFloat() {
  return getFloat(position);
}
origin: apache/mina

/**
 * @see ByteBuffer#getFloat(int)
 */
public float getFloat(int index) {
  return getFloat(getPointerByPosition(index));
}
origin: apache/mina

@Test
public void testFloat() {
  for (ByteOrder bo : new ByteOrder[] { ByteOrder.BIG_ENDIAN, ByteOrder.LITTLE_ENDIAN }) {
    ByteBuffer bb = (ByteBuffer) ByteBuffer.allocate(5).order(bo).putFloat(-0.68f).rewind();
    IoBuffer ioBuffer = IoBuffer.wrap(bb).order(bo);
    assertEquals(5, ioBuffer.capacity());
    ioBuffer.extend(3);
    ioBuffer.position(4);
    assertEquals(8, ioBuffer.capacity());
    ioBuffer.putFloat(3.14f);
    ioBuffer.rewind();
    assertEquals(-0.68f, ioBuffer.getFloat(), 0.001f);
    assertEquals(3.14f, ioBuffer.getFloat(), 0.001f);
    ioBuffer.rewind();
    ioBuffer.putFloat(2, -12.34f);
    assertEquals(-12.34f, ioBuffer.getFloat(2), 0.001f);
  }
}
org.apache.mina.codecIoBuffergetFloat

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
  • getInt
  • getLong
  • getShort
  • hasRemaining
  • getShort,
  • hasRemaining,
  • isDirect,
  • limit,
  • order,
  • position,
  • put,
  • putChar,
  • putDouble

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • Kernel (java.awt.image)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
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