Class ByteChunk

java.lang.Object
cool.scx.io.ByteChunk

public final class ByteChunk extends Object

ByteChunk

为了性能考虑 所有方法均没有 边界检查, 使用时请注意 参数正确

Version:
0.0.1
Author:
scx567888
  • Field Details

    • EMPTY_BYTE_CHUNK

      public static final ByteChunk EMPTY_BYTE_CHUNK
    • bytes

      public final byte[] bytes
    • start

      public final int start
    • end

      public final int end
    • length

      public final int length
  • Method Details

    • of

      public static ByteChunk of(byte... bytes)
    • of

      public static ByteChunk of(byte[] bytes, int start, int end)
    • of

      public static ByteChunk of(String str)
    • of

      public static ByteChunk of(String str, Charset charset)
    • getByte

      public byte getByte(int index)
      相对 索引 0 起始
    • getBytes

      public byte[] getBytes(int start, int end)
      相对 索引 0 起始
    • getBytes

      public byte[] getBytes(int start)
      相对 索引 0 起始
    • getBytes

      public byte[] getBytes()
      相对 索引 0 起始
    • toString

      public String toString(int start, int end)
      相对 索引 0 起始
    • toString

      public String toString(int start)
      相对 索引 0 起始
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • subChunk

      public ByteChunk subChunk(int start, int end)
      相对 索引 0 起始