Interface LeasedCharBuffer

All Superinterfaces:
AutoCloseable

public sealed interface LeasedCharBuffer extends AutoCloseable
A CharBuffer leased from a BufferAllocator.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Returns the leased char buffer to the buffer allocator it was obtained from.
    get()
    Gets the leased char buffer.
  • Method Details

    • get

      CharBuffer get()

      Gets the leased char buffer.

      Continued use of a closed char buffer can result in data corruption.

      Returns:
      the leased char buffer
      Throws:
      IllegalStateException - if close() has already been called
    • close

      void close()

      Returns the leased char buffer to the buffer allocator it was obtained from.

      Subsequent calls to this method have no effect. Calling get() after calling this method will throw IllegalStateException.

      Specified by:
      close in interface AutoCloseable