?? bytebuffer.java
字號:
/*
* Byte Buffer Class
* 1998/01/26 (C)Copyright T.Kazawa(Digitune)
*/
package JP.digitune.util;
public class ByteBuffer {
static final int BUF_SIZE = 8192;
protected byte[] buf = new byte[BUF_SIZE];
protected int end = 0;
public ByteBuffer(byte[] argbuf) {
System.arraycopy(argbuf, 0, buf, 0, argbuf.length);
end = argbuf.length;
}
public ByteBuffer() {
}
public void append(byte[] argbuf, int off, int len) {
if (len > buf.length - end) {
byte[] tmp = new byte[buf.length + BUF_SIZE];
System.arraycopy(buf, 0, tmp, 0, end);
buf = tmp;
}
System.arraycopy(argbuf, off, buf, end, len);
end += len;
}
public void append(byte[] argbuf) {
append(argbuf, 0, argbuf.length);
}
public byte[] getBytes() {
byte[] tmp = new byte[end];
System.arraycopy(buf, 0, tmp, 0, end);
return tmp;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -