18045010223
21 小时以前 39d4048dc6fd5a138bd1128c06bccca08fbc72f0
src/main/java/cn/org/hentai/jtt1078/util/ByteHolder.java
@@ -13,8 +13,6 @@
    public ByteHolder(int bufferSize)
    {
       System.out.print("ByteHolder(bufferSize:"+bufferSize+")");
        this.buffer = new byte[bufferSize];
    }
@@ -58,7 +56,6 @@
    public void sliceInto(byte[] dest, int length)
    {
        //System.out.println();
        System.arraycopy(this.buffer, 0, dest, 0, length);
        // 往前挪length个位
        System.arraycopy(this.buffer, length, this.buffer, 0, this.size - length);
@@ -96,4 +93,9 @@
        int l = this.buffer[position + 1] & 0xff;
        return ((h << 8) | l) & 0xffff;
    }
    // ✅ 添加这个方法
    public byte[] peek(int length) {
        if (size < length) return null;
        return Arrays.copyOfRange(this.buffer, 0, length);
    }
}