home *** CD-ROM | disk | FTP | other *** search
- package com.sun.j3d.internal;
-
- import java.nio.Buffer;
- import java.nio.ByteBuffer;
- import java.nio.DoubleBuffer;
- import java.nio.FloatBuffer;
- import javax.media.j3d.J3DBuffer;
-
- public abstract class BufferWrapper {
- public static final int TYPE_NULL = 0;
- public static final int TYPE_UNKNOWN = 1;
- public static final int TYPE_BYTE = 2;
- public static final int TYPE_FLOAT = 3;
- public static final int TYPE_DOUBLE = 4;
-
- abstract Buffer getBuffer();
-
- public Object getBufferAsObject() {
- return this.getBuffer();
- }
-
- public int capacity() {
- return this.getBuffer().capacity();
- }
-
- public int limit() {
- return this.getBuffer().limit();
- }
-
- public int position() {
- return this.getBuffer().position();
- }
-
- public BufferWrapper position(int var1) {
- this.getBuffer().position(var1);
- return this;
- }
-
- public BufferWrapper rewind() {
- this.getBuffer().rewind();
- return this;
- }
-
- public static int getBufferType(J3DBuffer var0) {
- Buffer var2 = var0.getBuffer();
- byte var1;
- if (var2 == null) {
- var1 = 0;
- } else if (var2 instanceof ByteBuffer) {
- var1 = 2;
- } else if (var2 instanceof FloatBuffer) {
- var1 = 3;
- } else if (var2 instanceof DoubleBuffer) {
- var1 = 4;
- } else {
- var1 = 1;
- }
-
- return var1;
- }
- }
-