Class BufferCaster

java.lang.Object
org.apache.camel.util.BufferCaster

public final class BufferCaster extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Buffer>
    Buffer
    cast(T byteBuffer)
    Without this cast, when the code compiled by Java 9+ is executed on Java 8, it will throw java.lang.NoSuchMethodError: Method flip()Ljava/nio/ByteBuffer; does not exist in class java.nio.ByteBuffer This is true for other method too: we list them here for completeness: position(int), limit(int), mark(), reset(), clear() and rewind()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • cast

      public static <T extends Buffer> Buffer cast(T byteBuffer)
      Without this cast, when the code compiled by Java 9+ is executed on Java 8, it will throw java.lang.NoSuchMethodError: Method flip()Ljava/nio/ByteBuffer; does not exist in class java.nio.ByteBuffer This is true for other method too: we list them here for completeness: position(int), limit(int), mark(), reset(), clear() and rewind()