Package org.linphone.core

# Interface Buffer

public interface Buffer
The object representing a data buffer.

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`getContent()`
Gets the content of the data buffer.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`int`
`getSize()`
Gets the size of the content of the data buffer.
`String`
`getStringContent()`
Gets the string content of the data buffer.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`boolean`
`isEmpty()`
Tell whether the `Buffer` is empty.
`Buffer`
`newFromData(byte[] data, int size)`
Creates a new `Buffer` object from existing data.
`Buffer`
`newFromString(String data)`
Creates a new `Buffer` object from a string.
`void`
`setContent(byte[] content, int size)`
Sets the content of the data buffer.
`void`
`setSize(int size)`
Sets the size of the content of the data buffer.
`void`
`setStringContent(String content)`
Sets the string content of the data buffer.
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getContent

@NonNull byte[] getContent()
Gets the content of the data buffer.

Returns:
  The content of the data buffer.

### isEmpty

boolean isEmpty()
Tell whether the `Buffer` is empty.

Returns:
  A boolean value telling whether the `Buffer` is empty or not.

### getSize

int getSize()
Gets the size of the content of the data buffer.

Returns:
  The size of the content of the data buffer.

### setSize

void setSize(int size)
Sets the size of the content of the data buffer.

Parameters:
  `size` - The size of the content of the data buffer.

### getStringContent

@NonNull String getStringContent()
Gets the string content of the data buffer.

Returns:
  The string content of the data buffer.

### setStringContent

void setStringContent(@NonNull String content)
Sets the string content of the data buffer.

Parameters:
  `content` - The string content of the data buffer.

### setContent

void setContent(@NonNull byte[] content, int size)
Sets the content of the data buffer.

Parameters:
  `content` - The content of the data buffer.
  `size` - The size of the content of the data buffer.

### newFromData

@NonNull Buffer newFromData(@NonNull byte[] data, int size)
Creates a new `Buffer` object from existing data.

Parameters:
  `data` - The initial data to store in the LinphoneBuffer.
  `size` - The size of the initial data to store in the LinphoneBuffer.
Returns:
  A new `Buffer` object.

### newFromString

@NonNull Buffer newFromString(@NonNull String data)
Creates a new `Buffer` object from a string.

Parameters:
  `data` - The initial string content of the LinphoneBuffer.
Returns:
  A new `Buffer` object.

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`