001: /*
002: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package com.tc.bytes;
006:
007: import com.tc.lang.Recyclable;
008:
009: import java.nio.ByteBuffer;
010:
011: public interface TCByteBuffer extends Recyclable {
012:
013: public TCByteBuffer clear();
014:
015: public TCByteBuffer reInit();
016:
017: public int capacity();
018:
019: public int position();
020:
021: public TCByteBuffer flip();
022:
023: public boolean hasRemaining();
024:
025: public int limit();
026:
027: public TCByteBuffer limit(int newLimit);
028:
029: public TCByteBuffer position(int newPosition);
030:
031: public int remaining();
032:
033: public com.tc.bytes.TCByteBuffer rewind();
034:
035: public ByteBuffer getNioBuffer();
036:
037: public boolean isDirect();
038:
039: public byte[] array();
040:
041: public byte get();
042:
043: public boolean getBoolean();
044:
045: public boolean getBoolean(int index);
046:
047: public char getChar();
048:
049: public char getChar(int index);
050:
051: public double getDouble();
052:
053: public double getDouble(int index);
054:
055: public float getFloat();
056:
057: public float getFloat(int index);
058:
059: public int getInt();
060:
061: public int getInt(int index);
062:
063: public long getLong();
064:
065: public long getLong(int index);
066:
067: public short getShort();
068:
069: public short getShort(int index);
070:
071: public TCByteBuffer get(byte[] dst);
072:
073: public TCByteBuffer get(byte[] dst, int offset, int length);
074:
075: public byte get(int index);
076:
077: public TCByteBuffer put(byte b);
078:
079: public TCByteBuffer put(byte[] src);
080:
081: public TCByteBuffer put(byte[] src, int offset, int length);
082:
083: public TCByteBuffer put(int index, byte b);
084:
085: public TCByteBuffer putBoolean(boolean b);
086:
087: public TCByteBuffer putBoolean(int index, boolean b);
088:
089: public TCByteBuffer putChar(char c);
090:
091: public TCByteBuffer putChar(int index, char c);
092:
093: public TCByteBuffer putDouble(double d);
094:
095: public TCByteBuffer putDouble(int index, double d);
096:
097: public TCByteBuffer putFloat(float f);
098:
099: public TCByteBuffer putFloat(int index, float f);
100:
101: public TCByteBuffer putInt(int i);
102:
103: public TCByteBuffer putInt(int index, int i);
104:
105: public TCByteBuffer putLong(long l);
106:
107: public TCByteBuffer putLong(int index, long l);
108:
109: public TCByteBuffer putShort(short s);
110:
111: public TCByteBuffer putShort(int index, short s);
112:
113: public TCByteBuffer duplicate();
114:
115: public TCByteBuffer put(TCByteBuffer src);
116:
117: public TCByteBuffer slice();
118:
119: public int arrayOffset();
120:
121: public TCByteBuffer asReadOnlyBuffer();
122:
123: public boolean isReadOnly();
124:
125: public boolean hasArray();
126:
127: public TCByteBuffer get(int index, byte[] dst);
128:
129: public TCByteBuffer get(int index, byte[] dst, int offset,
130: int length);
131:
132: public TCByteBuffer put(int index, byte[] src);
133:
134: public TCByteBuffer put(int index, byte[] src, int offset,
135: int length);
136:
137: public TCByteBuffer putUint(long i);
138:
139: public TCByteBuffer putUint(int index, long i);
140:
141: public TCByteBuffer putUshort(int s);
142:
143: public TCByteBuffer putUshort(int index, int s);
144:
145: public long getUint();
146:
147: public long getUint(int index);
148:
149: public int getUshort();
150:
151: public int getUshort(int index);
152:
153: public short getUbyte();
154:
155: public short getUbyte(int index);
156:
157: public TCByteBuffer putUbyte(int index, short value);
158:
159: public TCByteBuffer putUbyte(short value);
160:
161: public void commit();
162:
163: public void checkedOut();
164:
165: }
|