Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.nio
Class ByteBufferImpl  view ByteBufferImpl download ByteBufferImpl.java

java.lang.Object
  extended byjava.nio.Buffer
      extended byjava.nio.ByteBuffer
          extended byjava.nio.ByteBufferImpl
All Implemented Interfaces:
java.lang.Comparable

final class ByteBufferImpl
extends ByteBuffer

This is a Heap memory implementation


Field Summary
private  boolean readOnly
           
 
Fields inherited from class java.nio.ByteBuffer
array_offset, backing_buffer, endian
 
Fields inherited from class java.nio.Buffer
address, cap, limit, mark, pos
 
Constructor Summary
(package private) ByteBufferImpl(byte[] buffer, int offset, int capacity, int limit, int position, int mark, boolean readOnly)
           
 
Method Summary
 CharBuffer asCharBuffer()
          Creates a view of this byte buffer as a char buffer.
 DoubleBuffer asDoubleBuffer()
          Creates a view of this byte buffer as a double buffer.
 FloatBuffer asFloatBuffer()
          Creates a view of this byte buffer as a float buffer.
 IntBuffer asIntBuffer()
          Creates a view of this byte buffer as an integer buffer.
 LongBuffer asLongBuffer()
          Creates a view of this byte buffer as a long buffer.
 ByteBuffer asReadOnlyBuffer()
          Creates a new read-only ByteBuffer that shares this buffer's content.
 ShortBuffer asShortBuffer()
          Creates a view of this byte buffer as a short buffer.
 ByteBuffer compact()
          Compacts this buffer.
 ByteBuffer duplicate()
          Creates a new ByteBuffer that shares this buffer's content.
 byte get()
          Reads the byte at this buffer's current position, and then increments the position.
 ByteBuffer get(byte[] dst, int offset, int length)
          Bulk get
 byte get(int index)
          Absolute get method.
 char getChar()
          Relative get method for reading a character value.
 char getChar(int index)
          Absolute get method for reading a character value.
 double getDouble()
          Relative get method for reading a double value.
 double getDouble(int index)
          Absolute get method for reading a double value.
 float getFloat()
          Relative get method for reading a float value.
 float getFloat(int index)
          Absolute get method for reading a float value.
 int getInt()
          Relative get method for reading an integer value.
 int getInt(int index)
          Absolute get method for reading an integer value.
 long getLong()
          Relative get method for reading a long value.
 long getLong(int index)
          Absolute get method for reading a long value.
 short getShort()
          Relative get method for reading a short value.
 short getShort(int index)
          Absolute get method for reading a short value.
 boolean isDirect()
          Tells whether or not this buffer is direct.
 boolean isReadOnly()
          Tells whether this buffer is read only or not.
 ByteBuffer put(byte value)
          Relative put method.
 ByteBuffer put(byte[] src, int offset, int length)
          Relative bulk put(), overloads the ByteBuffer impl.
 ByteBuffer put(int index, byte value)
          Absolute put method.
 ByteBuffer putChar(char value)
          Relative put method for writing a character value.
 ByteBuffer putChar(int index, char value)
          Absolute put method for writing a character value.
 ByteBuffer putDouble(double value)
          Relative put method for writing a double value.
 ByteBuffer putDouble(int index, double value)
          Absolute put method for writing a double value.
 ByteBuffer putFloat(float value)
          Relative put method for writing a float value.
 ByteBuffer putFloat(int index, float value)
          Relative put method for writing a float value.
 ByteBuffer putInt(int value)
          Relative put method for writing an integer value.
 ByteBuffer putInt(int index, int value)
          Absolute put method for writing an integer value.
 ByteBuffer putLong(int index, long value)
          Absolute put method for writing a float value.
 ByteBuffer putLong(long value)
          Relative put method for writing a long value.
 ByteBuffer putShort(int index, short value)
          Absolute put method for writing a short value.
 ByteBuffer putShort(short value)
          Relative put method for writing a short value.
(package private)  void shiftDown(int dst_offset, int src_offset, int count)
           
 ByteBuffer slice()
          Creates a new ByteBuffer whose content is a shared subsequence of this buffer's content.
 
Methods inherited from class java.nio.ByteBuffer
allocate, allocateDirect, array, arrayOffset, compareTo, equals, get, hasArray, hashCode, order, order, put, put, toString, wrap, wrap
 
Methods inherited from class java.nio.Buffer
capacity, checkArraySize, checkForOverflow, checkForOverflow, checkForUnderflow, checkForUnderflow, checkIfReadOnly, checkIndex, clear, flip, hasRemaining, limit, limit, mark, position, position, remaining, reset, rewind
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

readOnly

private boolean readOnly
Constructor Detail

ByteBufferImpl

ByteBufferImpl(byte[] buffer,
               int offset,
               int capacity,
               int limit,
               int position,
               int mark,
               boolean readOnly)
Method Detail

asCharBuffer

public CharBuffer asCharBuffer()
Description copied from class: ByteBuffer
Creates a view of this byte buffer as a char buffer.

Specified by:
asCharBuffer in class ByteBuffer

asShortBuffer

public ShortBuffer asShortBuffer()
Description copied from class: ByteBuffer
Creates a view of this byte buffer as a short buffer.

Specified by:
asShortBuffer in class ByteBuffer

asIntBuffer

public IntBuffer asIntBuffer()
Description copied from class: ByteBuffer
Creates a view of this byte buffer as an integer buffer.

Specified by:
asIntBuffer in class ByteBuffer

asLongBuffer

public LongBuffer asLongBuffer()
Description copied from class: ByteBuffer
Creates a view of this byte buffer as a long buffer.

Specified by:
asLongBuffer in class ByteBuffer

asFloatBuffer

public FloatBuffer asFloatBuffer()
Description copied from class: ByteBuffer
Creates a view of this byte buffer as a float buffer.

Specified by:
asFloatBuffer in class ByteBuffer

asDoubleBuffer

public DoubleBuffer asDoubleBuffer()
Description copied from class: ByteBuffer
Creates a view of this byte buffer as a double buffer.

Specified by:
asDoubleBuffer in class ByteBuffer

isReadOnly

public boolean isReadOnly()
Description copied from class: Buffer
Tells whether this buffer is read only or not.

Specified by:
isReadOnly in class Buffer

slice

public ByteBuffer slice()
Description copied from class: ByteBuffer
Creates a new ByteBuffer whose content is a shared subsequence of this buffer's content.

Specified by:
slice in class ByteBuffer

duplicate

public ByteBuffer duplicate()
Description copied from class: ByteBuffer
Creates a new ByteBuffer that shares this buffer's content.

Specified by:
duplicate in class ByteBuffer

asReadOnlyBuffer

public ByteBuffer asReadOnlyBuffer()
Description copied from class: ByteBuffer
Creates a new read-only ByteBuffer that shares this buffer's content.

Specified by:
asReadOnlyBuffer in class ByteBuffer

shiftDown

void shiftDown(int dst_offset,
               int src_offset,
               int count)
Overrides:
shiftDown in class ByteBuffer

compact

public ByteBuffer compact()
Description copied from class: ByteBuffer
Compacts this buffer.

Specified by:
compact in class ByteBuffer

isDirect

public boolean isDirect()
Description copied from class: ByteBuffer
Tells whether or not this buffer is direct.

Specified by:
isDirect in class ByteBuffer

get

public byte get()
Reads the byte at this buffer's current position, and then increments the position.

Specified by:
get in class ByteBuffer

get

public ByteBuffer get(byte[] dst,
                      int offset,
                      int length)
Bulk get

Overrides:
get in class ByteBuffer

put

public ByteBuffer put(byte[] src,
                      int offset,
                      int length)
Relative bulk put(), overloads the ByteBuffer impl.

Overrides:
put in class ByteBuffer

put

public ByteBuffer put(byte value)
Relative put method. Writes value to the next position in the buffer.

Specified by:
put in class ByteBuffer

get

public byte get(int index)
Absolute get method. Reads the byte at position index.

Specified by:
get in class ByteBuffer

put

public ByteBuffer put(int index,
                      byte value)
Absolute put method. Writes value to position index in the buffer.

Specified by:
put in class ByteBuffer

getChar

public char getChar()
Description copied from class: ByteBuffer
Relative get method for reading a character value.

Specified by:
getChar in class ByteBuffer

putChar

public ByteBuffer putChar(char value)
Description copied from class: ByteBuffer
Relative put method for writing a character value.

Specified by:
putChar in class ByteBuffer

getChar

public char getChar(int index)
Description copied from class: ByteBuffer
Absolute get method for reading a character value.

Specified by:
getChar in class ByteBuffer

putChar

public ByteBuffer putChar(int index,
                          char value)
Description copied from class: ByteBuffer
Absolute put method for writing a character value.

Specified by:
putChar in class ByteBuffer

getShort

public short getShort()
Description copied from class: ByteBuffer
Relative get method for reading a short value.

Specified by:
getShort in class ByteBuffer

putShort

public ByteBuffer putShort(short value)
Description copied from class: ByteBuffer
Relative put method for writing a short value.

Specified by:
putShort in class ByteBuffer

getShort

public short getShort(int index)
Description copied from class: ByteBuffer
Absolute get method for reading a short value.

Specified by:
getShort in class ByteBuffer

putShort

public ByteBuffer putShort(int index,
                           short value)
Description copied from class: ByteBuffer
Absolute put method for writing a short value.

Specified by:
putShort in class ByteBuffer

getInt

public int getInt()
Description copied from class: ByteBuffer
Relative get method for reading an integer value.

Specified by:
getInt in class ByteBuffer

putInt

public ByteBuffer putInt(int value)
Description copied from class: ByteBuffer
Relative put method for writing an integer value.

Specified by:
putInt in class ByteBuffer

getInt

public int getInt(int index)
Description copied from class: ByteBuffer
Absolute get method for reading an integer value.

Specified by:
getInt in class ByteBuffer

putInt

public ByteBuffer putInt(int index,
                         int value)
Description copied from class: ByteBuffer
Absolute put method for writing an integer value.

Specified by:
putInt in class ByteBuffer

getLong

public long getLong()
Description copied from class: ByteBuffer
Relative get method for reading a long value.

Specified by:
getLong in class ByteBuffer

putLong

public ByteBuffer putLong(long value)
Description copied from class: ByteBuffer
Relative put method for writing a long value.

Specified by:
putLong in class ByteBuffer

getLong

public long getLong(int index)
Description copied from class: ByteBuffer
Absolute get method for reading a long value.

Specified by:
getLong in class ByteBuffer

putLong

public ByteBuffer putLong(int index,
                          long value)
Description copied from class: ByteBuffer
Absolute put method for writing a float value.

Specified by:
putLong in class ByteBuffer

getFloat

public float getFloat()
Description copied from class: ByteBuffer
Relative get method for reading a float value.

Specified by:
getFloat in class ByteBuffer

putFloat

public ByteBuffer putFloat(float value)
Description copied from class: ByteBuffer
Relative put method for writing a float value.

Specified by:
putFloat in class ByteBuffer

getFloat

public float getFloat(int index)
Description copied from class: ByteBuffer
Absolute get method for reading a float value.

Specified by:
getFloat in class ByteBuffer

putFloat

public ByteBuffer putFloat(int index,
                           float value)
Description copied from class: ByteBuffer
Relative put method for writing a float value.

Specified by:
putFloat in class ByteBuffer

getDouble

public double getDouble()
Description copied from class: ByteBuffer
Relative get method for reading a double value.

Specified by:
getDouble in class ByteBuffer

putDouble

public ByteBuffer putDouble(double value)
Description copied from class: ByteBuffer
Relative put method for writing a double value.

Specified by:
putDouble in class ByteBuffer

getDouble

public double getDouble(int index)
Description copied from class: ByteBuffer
Absolute get method for reading a double value.

Specified by:
getDouble in class ByteBuffer

putDouble

public ByteBuffer putDouble(int index,
                            double value)
Description copied from class: ByteBuffer
Absolute put method for writing a double value.

Specified by:
putDouble in class ByteBuffer