Class ByteBufferRewinder

  • All Implemented Interfaces:
    DataRewinder<java.nio.ByteBuffer>

    public class ByteBufferRewinder
    extends java.lang.Object
    implements DataRewinder<java.nio.ByteBuffer>
    Rewinds ByteBuffers.
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteBufferRewinder​(java.nio.ByteBuffer buffer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanup()
      Called when this rewinder is no longer needed and can be cleaned up.
      java.nio.ByteBuffer rewindAndGet()
      Rewinds the wrapped data back to the beginning and returns the re-wound data (or a wrapper for the re-wound data).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteBufferRewinder

        public ByteBufferRewinder​(java.nio.ByteBuffer buffer)
    • Method Detail

      • rewindAndGet

        @NonNull
        public java.nio.ByteBuffer rewindAndGet()
        Description copied from interface: DataRewinder
        Rewinds the wrapped data back to the beginning and returns the re-wound data (or a wrapper for the re-wound data).
        Specified by:
        rewindAndGet in interface DataRewinder<java.nio.ByteBuffer>
        Returns:
        An object pointing to the wrapped data.
      • cleanup

        public void cleanup()
        Description copied from interface: DataRewinder
        Called when this rewinder is no longer needed and can be cleaned up.

        The underlying data may still be in use and should not be closed or invalidated.

        Specified by:
        cleanup in interface DataRewinder<java.nio.ByteBuffer>