org.python.core

## Interface BufferProtocol

All Known Subinterfaces:
  PyBuffer

All Known Implementing Classes:
  BaseBuffer, Py2kBuffer, PyArray, PyArrayDerived, PyByteArray, PyByteArrayDerived, PyMemoryView, PyString, PyStringDerived, PyUnicode, PyUnicodeDerived, SimpleBuffer, SimpleStringBuffer, SimpleWritableBuffer, Strided1DBuffer, Strided1DWritableBuffer, SyspathArchive, ZeroByteBuffer

    public interface BufferProtocol

Interface marking an object as capable of exposing its internal state as a `PyBuffer`.

### Method Summary

Methods
`PyBuffer` `getBuffer(int flags)` Method by which the consumer requests the buffer from the exporter.

### Method Detail

#### getBuffer

    PyBuffer getBuffer(int flags)
                       throws PyException

Method by which the consumer requests the buffer from the exporter. The consumer provides information on its intended method of navigation and the features the buffer object is asked (or assumed) to provide. Each consumer requesting a buffer in this way, when it has finished using it, should make a corresponding call to `PyBuffer.release()` on the buffer it obtained, since some objects alter their behaviour while buffers are exported.

Parameters:
  `flags` - specifying features demanded and the navigational capabilities of the consumer
Returns:
  exported buffer
Throws:
  `PyException` - (BufferError) when expectations do not correspond with the buffer