📄 bytesutile.java
字号:
package org.lazybug.util;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: lazybug</p>
*
* @author David Lau
* @version 1.0
*/
public class BytesUtile
{
private static final int SIZE = 500*1024;
private static byte[] buffer = new byte[SIZE];
private static int index = 0;
public static void init()
{
index = 0;
}
public static void write(int ch)
{
buffer[index++] = (byte)ch;
}
public static void rollback(int k)
{
index -= k;
if( index < 0 ) index = 0;
}
public static byte[] getPayload()
{
// System.out.println("getPayload:"+index);
byte buf[] = new byte[index];
index = 0;
Tools.copyByteArray(buffer, buf);
return buf;
}
public static void main( String[] args )
{
BytesUtile bytesutile = new BytesUtile();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -