com.sun.grizzly.memory.slab
Class Slab

java.lang.Object
  extended by com.sun.grizzly.memory.slab.Slab

public class Slab
extends Object

Author:
Ken Cavanaugh, John Vieten

Nested Class Summary
static class Slab.State
           
 
Constructor Summary
Slab(int size, boolean bufferType)
           
 
Method Summary
 ByteBuffer allocate(int size)
           
 int currentPosition()
           
 void dispose(ByteBuffer buffer)
           
 Slab.State getState()
           
 void markEmpty()
           
 void markFull()
           
 int sizeAllocated()
           
 int sizeAvailable()
           
 int sizeDisposed()
           
 int totalSize()
           
 ByteBuffer trim(int bufferStartPosition, ByteBuffer buffer, int sizeNeeded)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Slab

public Slab(int size,
            boolean bufferType)
Method Detail

currentPosition

public int currentPosition()

getState

public Slab.State getState()

totalSize

public int totalSize()

sizeAvailable

public int sizeAvailable()

sizeAllocated

public int sizeAllocated()

sizeDisposed

public int sizeDisposed()

markFull

public void markFull()

markEmpty

public void markEmpty()

allocate

public ByteBuffer allocate(int size)

dispose

public void dispose(ByteBuffer buffer)

trim

public ByteBuffer trim(int bufferStartPosition,
                       ByteBuffer buffer,
                       int sizeNeeded)


Copyright © 2009 SUN Microsystems. All Rights Reserved.