18#ifndef _DECAF_NIO_BYTEBUFFER_H_
19#define _DECAF_NIO_BYTEBUFFER_H_
218 ByteBuffer&
put(
const unsigned char* buffer,
int size,
int offset,
int length);
450 virtual unsigned char get()
const = 0;
463 virtual unsigned char get(
int index)
const = 0;
559 virtual long long getLong(
int index)
const = 0;
This interface imposes a total ordering on the objects of each class that implements it.
Definition Comparable.h:33
virtual int capacity() const
Definition Buffer.h:145
virtual bool equals(const ByteBuffer &value) const
static ByteBuffer * allocate(int capacity)
Allocates a new byte buffer whose position will be zero its limit will be its capacity and its mark i...
virtual ByteBuffer & putLong(long long value)=0
Writes eight bytes containing the given value, into this buffer at the current position,...
virtual unsigned char get() const =0
Relative get method.
virtual CharBuffer * asCharBuffer() const =0
Creates a view of this byte buffer as a char buffer.
virtual ByteBuffer & putInt(int value)=0
Writes four bytes containing the given value, into this buffer at the current position,...
virtual int compareTo(const ByteBuffer &value) const
virtual double getDouble(int index) const =0
Reads eight bytes at the given index and returns it.
virtual ShortBuffer * asShortBuffer() const =0
Creates a view of this byte buffer as a short buffer.
ByteBuffer & get(unsigned char *buffer, int size, int offset, int length)
Relative bulk get method.
ByteBuffer(int capacity)
Creates a ByteBuffer object that has its backing array allocated internally and is then owned and del...
static ByteBuffer * wrap(std::vector< unsigned char > &buffer)
Wraps the passed STL Byte Vector in a ByteBuffer.
virtual ~ByteBuffer()
Definition ByteBuffer.h:115
virtual unsigned char * array()=0
Returns the byte array that backs this buffer.
virtual IntBuffer * asIntBuffer() const =0
Creates a view of this byte buffer as a int buffer.
virtual char getChar()=0
Reads the next byte at this buffer's current position, and then increments the position by one.
virtual ByteBuffer & putFloat(float value)=0
Writes four bytes containing the given value, into this buffer at the current position,...
virtual ByteBuffer & putShort(short value)=0
Writes two bytes containing the given value, into this buffer at the current position,...
ByteBuffer & get(std::vector< unsigned char > buffer)
Relative bulk get method.
virtual unsigned char get(int index) const =0
Absolute get method.
ByteBuffer & put(ByteBuffer &src)
This method transfers the bytes remaining in the given source buffer into this buffer.
virtual ByteBuffer & putShort(int index, short value)=0
Writes two bytes containing the given value, into this buffer at the given index.
virtual float getFloat()=0
Reads the next four bytes at this buffer's current position, and then increments the position by that...
virtual bool operator==(const ByteBuffer &value) const
virtual int getInt()=0
Reads the next four bytes at this buffer's current position, and then increments the position by that...
virtual bool isReadOnly() const =0
Tells whether or not this buffer is read-only.
virtual ByteBuffer & putDouble(int index, double value)=0
Writes eight bytes containing the given value, into this buffer at the given index.
virtual ByteBuffer & compact()=0
Compacts this buffer.
virtual ByteBuffer & putChar(int index, char value)=0
Writes one byte containing the given value, into this buffer at the given index.
virtual ByteBuffer & putFloat(int index, float value)=0
Writes four bytes containing the given value, into this buffer at the given index.
virtual long long getLong(int index) const =0
Reads eight bytes at the given index and returns it.
virtual bool hasArray() const =0
Tells whether or not this buffer is backed by an accessible byte array.
virtual int getInt(int index) const =0
Reads four bytes at the given index and returns it.
virtual ByteBuffer & putInt(int index, int value)=0
Writes four bytes containing the given value, into this buffer at the given index.
ByteBuffer & put(std::vector< unsigned char > &buffer)
This method transfers the entire content of the given source byte array into this buffer.
virtual ByteBuffer * asReadOnlyBuffer() const =0
Creates a new, read-only byte buffer that shares this buffer's content.
ByteBuffer & put(const unsigned char *buffer, int size, int offset, int length)
This method transfers bytes into this buffer from the given source array.
virtual int arrayOffset() const =0
Returns the offset within this buffer's backing array of the first element of the buffer.
virtual FloatBuffer * asFloatBuffer() const =0
Creates a view of this byte buffer as a float buffer.
virtual float getFloat(int index) const =0
Reads four bytes at the given index and returns it.
virtual long long getLong()=0
Reads the next eight bytes at this buffer's current position, and then increments the position by tha...
static ByteBuffer * wrap(unsigned char *array, int size, int offset, int length)
Wraps the passed buffer with a new ByteBuffer.
virtual char getChar(int index) const =0
Reads one byte at the given index and returns it.
virtual ByteBuffer & putLong(int index, long long value)=0
Writes eight bytes containing the given value, into this buffer at the given index.
virtual std::string toString() const
virtual ByteBuffer & putDouble(double value)=0
Writes eight bytes containing the given value, into this buffer at the current position,...
virtual short getShort()=0
Reads the next two bytes at this buffer's current position, and then increments the position by that ...
virtual ByteBuffer * duplicate()=0
Creates a new byte buffer that shares this buffer's content.
virtual ByteBuffer & put(unsigned char value)=0
Writes the given byte into this buffer at the current position, and then increments the position.
virtual ByteBuffer & putChar(char value)=0
Writes one byte containing the given value, into this buffer at the current position,...
virtual DoubleBuffer * asDoubleBuffer() const =0
Creates a view of this byte buffer as a double buffer.
virtual ByteBuffer & put(int index, unsigned char value)=0
Writes the given byte into this buffer at the given index.
virtual short getShort(int index) const =0
Reads two bytes at the given index and returns it.
virtual LongBuffer * asLongBuffer() const =0
Creates a view of this byte buffer as a long buffer.
virtual double getDouble()=0
Reads the next eight bytes at this buffer's current position, and then increments the position by tha...
virtual bool operator<(const ByteBuffer &value) const
virtual ByteBuffer * slice() const =0
Creates a new byte buffer whose content is a shared subsequence of this buffer's content.
This class defines four categories of operations upon character buffers:
Definition CharBuffer.h:68
This class defines four categories of operations upon double buffers:
Definition DoubleBuffer.h:53
This class defines four categories of operations upon float buffers:
Definition FloatBuffer.h:51
This class defines four categories of operations upon int buffers:
Definition IntBuffer.h:51
This class defines four categories of operations upon long long buffers:
Definition LongBuffer.h:51
This class defines four categories of operations upon short buffers:
Definition ShortBuffer.h:51
#define DECAF_API
Definition Config.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25