18#ifndef _DECAF_INTERNAL_NIO_CHARARRAYBUFFER_H_
19#define _DECAF_INTERNAL_NIO_CHARARRAYBUFFER_H_
35 using decaf::internal::util::ByteArrayAdapter;
155 virtual char get(
int index )
const;
166 return this->readOnly;
198 this->readOnly = value;
virtual lang::CharSequence * subSequence(int start, int end) const
Creates a new character buffer that represents the specified subsequence of this buffer,...
CharArrayBuffer(int size, bool readOnly=false)
Creates a CharArrayBuffer object that has its backing array allocated internally and is then owned an...
CharArrayBuffer(const CharArrayBuffer &other)
Create a CharArrayBuffer that mirrors this one, meaning it shares a reference to this buffers ByteArr...
decaf::lang::Pointer< ByteArrayAdapter > _array
Definition CharArrayBuffer.h:41
virtual char get()
Relative get method.Reads the character at this buffer's current position, and then increments the po...
virtual bool hasArray() const
Tells whether or not this buffer is backed by an accessible char array.If this method returns true th...
Definition CharArrayBuffer.h:160
int offset
Definition CharArrayBuffer.h:44
virtual bool isReadOnly() const
Tells whether or not this buffer is read-only.true if, and only if, this buffer is read-only.
Definition CharArrayBuffer.h:165
virtual CharBuffer & put(int index, char value)
Writes the given char into this buffer at the given index.a reference to this buffer.
virtual ~CharArrayBuffer()
virtual char * array()
Returns the character array that backs this buffer (optional operation).Modifications to this buffer'...
virtual CharBuffer & put(char value)
Writes the given char into this buffer at the current position, and then increments the position....
virtual char get(int index) const
Absolute get method.Reads the char at the given index.the char that is located at the given index.
virtual CharBuffer * asReadOnlyBuffer() const
Creates a new, read-only char buffer that shares this buffer's content.The content of the new buffer ...
CharArrayBuffer(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 CharBuffer * duplicate()
Creates a new char buffer that shares this buffer's content.The content of the new buffer will be tha...
bool readOnly
Definition CharArrayBuffer.h:50
CharArrayBuffer(char *array, int size, int offset, int length, bool readOnly=false)
Creates a CharArrayBuffer object that wraps the given array.
virtual void setReadOnly(bool value)
Sets this CharArrayBuffer as Read-Only.
Definition CharArrayBuffer.h:197
virtual CharBuffer & compact()
Compacts this buffer.The bytes between the buffer's current position and its limit,...
virtual CharBuffer * slice() const
Creates a new CharBuffer whose content is a shared subsequence of this buffer's content....
virtual int arrayOffset()
Returns the offset within this buffer's backing array of the first element of the buffer (optional op...
int length
Definition CharArrayBuffer.h:47
A CharSequence is a readable sequence of char values.
Definition CharSequence.h:36
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
This class defines four categories of operations upon character buffers:
Definition CharBuffer.h:68
CharBuffer(int capacity)
Creates a CharBuffer object that has its backing array allocated internally and is then owned and del...
#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