18#ifndef _DECAF_INTERNAL_NIO_BYTEBUFFER_H_
19#define _DECAF_INTERNAL_NIO_BYTEBUFFER_H_
43 using decaf::internal::util::ByteArrayAdapter;
154 bool readOnly =
false );
174 int offset,
int length,
bool readOnly =
false );
194 return this->readOnly;
262 virtual unsigned char get()
const;
267 virtual unsigned char get(
int index )
const;
273 return (
char)this->
get();
281 return (
char)this->
get( index );
418 this->readOnly = value;
virtual unsigned char * array()
Returns the byte array that backs this buffer.Modifications to this buffer's content will cause the r...
virtual decaf::nio::DoubleBuffer * asDoubleBuffer() const
Creates a view of this byte buffer as a double buffer.The content of the new buffer will start at thi...
Definition ByteArrayBuffer.h:222
virtual long long getLong()
Reads the next eight bytes at this buffer's current position, and then increments the position by tha...
virtual int arrayOffset() const
Returns the offset within this buffer's backing array of the first element of the buffer....
virtual void setReadOnly(bool value)
Sets this ByteArrayBuffer as Read-Only or not Read-Only.
Definition ByteArrayBuffer.h:417
virtual double getDouble()
Reads the next eight bytes at this buffer's current position, and then increments the position by tha...
virtual ByteArrayBuffer & putFloat(int index, float value)
Writes four bytes containing the given value, into this buffer at the given index....
virtual ByteArrayBuffer & put(unsigned char value)
Writes the given byte into this buffer at the current position, and then increments the position....
ByteArrayBuffer(int capacity, bool readOnly=false)
Creates a ByteArrayBuffer object that has its backing array allocated internally and is then owned an...
virtual ByteArrayBuffer & putShort(short value)
Writes two bytes containing the given value, into this buffer at the current position,...
ByteArrayBuffer(unsigned char *array, int size, int offset, int length, bool readOnly=false)
Creates a ByteArrayBuffer object that wraps the given array.
virtual ByteArrayBuffer & putFloat(float value)
Writes four bytes containing the given value, into this buffer at the current position,...
virtual decaf::nio::CharBuffer * asCharBuffer() const
Creates a view of this byte buffer as a char buffer.The content of the new buffer will start at this ...
Definition ByteArrayBuffer.h:217
virtual ByteArrayBuffer & compact()
Compacts this buffer.The bytes between the buffer's current position and its limit,...
virtual ByteArrayBuffer & putChar(char value)
Writes one byte containing the given value, into this buffer at the current position,...
virtual ByteArrayBuffer & putInt(int value)
Writes four bytes containing the given value, into this buffer at the current position,...
virtual ByteArrayBuffer & putDouble(int index, double value)
Writes eight bytes containing the given value, into this buffer at the given index....
ByteArrayBuffer(const ByteArrayBuffer &other)
Create a ByteArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArr...
virtual float getFloat(int index) const
Reads four bytes at the given index and returns it.the float at the given index in the buffer.
virtual ByteArrayBuffer & putShort(int index, short value)
Writes two bytes containing the given value, into this buffer at the given index.a reference to this ...
virtual bool isReadOnly() const
Tells whether or not this buffer is read-only.true if, and only if, this buffer is read-only
Definition ByteArrayBuffer.h:193
virtual char getChar(int index) const
Reads one byte at the given index and returns it.the char at the given index in the buffer
Definition ByteArrayBuffer.h:279
virtual int getInt(int index) const
Reads four bytes at the given index and returns it.the int at the given index in the buffer.
virtual decaf::nio::ShortBuffer * asShortBuffer() const
Creates a view of this byte buffer as a short buffer.The content of the new buffer will start at this...
Definition ByteArrayBuffer.h:242
ByteArrayBuffer(const decaf::lang::Pointer< ByteArrayAdapter > &array, int offset, int length, bool readOnly=false)
Creates a byte buffer that wraps the passed ByteArrayAdapter and start at the given offset.
virtual ByteArrayBuffer & putChar(int index, char value)
Writes one byte containing the given value, into this buffer at the given index.a reference to this b...
virtual char getChar()
Reads the next byte at this buffer's current position, and then increments the position by one....
Definition ByteArrayBuffer.h:272
virtual ~ByteArrayBuffer()
virtual ByteArrayBuffer & putLong(long long value)
Writes eight bytes containing the given value, into this buffer at the current position,...
virtual bool hasArray() const
Tells whether or not this buffer is backed by an accessible byte array.If this method returns true th...
Definition ByteArrayBuffer.h:210
virtual unsigned char get(int index) const
Absolute get method.Reads the byte at the given index.the byte that is located at the given index.
virtual ByteArrayBuffer & putDouble(double value)
Writes eight bytes containing the given value, into this buffer at the current position,...
virtual ByteArrayBuffer * duplicate()
Creates a new byte buffer that shares this buffer's content.The content of the new buffer will be tha...
virtual ByteArrayBuffer & put(int index, unsigned char value)
Writes the given byte into this buffer at the given index.a reference to this buffer.
virtual double getDouble(int index) const
Reads eight bytes at the given index and returns it.the double at the given index in the buffer.
virtual short getShort()
Reads the next two bytes at this buffer's current position, and then increments the position by that ...
virtual ByteArrayBuffer & putLong(int index, long long value)
Writes eight bytes containing the given value, into this buffer at the given index....
virtual int getInt()
Reads the next four bytes at this buffer's current position, and then increments the position by that...
virtual ByteArrayBuffer & putInt(int index, int value)
Writes four bytes containing the given value, into this buffer at the given index....
virtual ByteArrayBuffer * slice() const
Creates a new byte buffer whose content is a shared subsequence of this buffer's content....
virtual decaf::nio::LongBuffer * asLongBuffer() const
Creates a view of this byte buffer as a long buffer.The content of the new buffer will start at this ...
Definition ByteArrayBuffer.h:237
virtual float getFloat()
Reads the next four bytes at this buffer's current position, and then increments the position by that...
virtual unsigned char get() const
Relative get method.Reads the byte at this buffer's current position, and then increments the positio...
virtual ByteArrayBuffer * asReadOnlyBuffer() const
Creates a new, read-only byte buffer that shares this buffer's content.The content of the new buffer ...
virtual decaf::nio::IntBuffer * asIntBuffer() const
Creates a view of this byte buffer as a int buffer.The content of the new buffer will start at this b...
Definition ByteArrayBuffer.h:232
virtual long long getLong(int index) const
Reads eight bytes at the given index and returns it.the long long at the given index in the buffer.
virtual decaf::nio::FloatBuffer * asFloatBuffer() const
Creates a view of this byte buffer as a float buffer.The content of the new buffer will start at this...
Definition ByteArrayBuffer.h:227
virtual short getShort(int index) const
Reads two bytes at the given index and returns it.the short at the given index in the buffer.
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
virtual int capacity() const
Definition Buffer.h:145
This class defines six categories of operations upon byte buffers:
Definition ByteBuffer.h:98
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 NULL
Definition Config.h:33
#define DECAF_API
Definition Config.h:29
Definition BufferFactory.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25