/** * Factory method for constructing compressed chunk */ public static LZFChunk createNonCompressed(byte[] plainData, int ptr, int len) { byte[] result = new byte[len + HEADER_LEN_NOT_COMPRESSED]; result[0] = BYTE_Z; result[1] = BYTE_V; result[2] = BLOCK_TYPE_NON_COMPRESSED; result[3] = (byte) (len >> 8); result[4] = (byte) len; System.arraycopy(plainData, ptr, result, HEADER_LEN_NOT_COMPRESSED, len); return new LZFChunk(result); }
/** * Factory method for constructing compressed chunk */ public static LZFChunk createNonCompressed(byte[] plainData, int ptr, int len) { byte[] result = new byte[len + HEADER_LEN_NOT_COMPRESSED]; result[0] = BYTE_Z; result[1] = BYTE_V; result[2] = BLOCK_TYPE_NON_COMPRESSED; result[3] = (byte) (len >> 8); result[4] = (byte) len; System.arraycopy(plainData, ptr, result, HEADER_LEN_NOT_COMPRESSED, len); return new LZFChunk(result); }
/** * Factory method for constructing compressed chunk */ public static LZFChunk createCompressed(int origLen, byte[] encData, int encPtr, int encLen) { byte[] result = new byte[encLen + HEADER_LEN_COMPRESSED]; result[0] = BYTE_Z; result[1] = BYTE_V; result[2] = BLOCK_TYPE_COMPRESSED; result[3] = (byte) (encLen >> 8); result[4] = (byte) encLen; result[5] = (byte) (origLen >> 8); result[6] = (byte) origLen; System.arraycopy(encData, encPtr, result, HEADER_LEN_COMPRESSED, encLen); return new LZFChunk(result); }
/** * Factory method for constructing compressed chunk */ public static LZFChunk createNonCompressed(byte[] plainData, int ptr, int len) { byte[] result = new byte[len + HEADER_LEN_NOT_COMPRESSED]; result[0] = BYTE_Z; result[1] = BYTE_V; result[2] = BLOCK_TYPE_NON_COMPRESSED; result[3] = (byte) (len >> 8); result[4] = (byte) len; System.arraycopy(plainData, ptr, result, HEADER_LEN_NOT_COMPRESSED, len); return new LZFChunk(result); }
/** * Factory method for constructing compressed chunk */ public static LZFChunk createCompressed(int origLen, byte[] encData, int encPtr, int encLen) { byte[] result = new byte[encLen + HEADER_LEN_COMPRESSED]; result[0] = BYTE_Z; result[1] = BYTE_V; result[2] = BLOCK_TYPE_COMPRESSED; result[3] = (byte) (encLen >> 8); result[4] = (byte) encLen; result[5] = (byte) (origLen >> 8); result[6] = (byte) origLen; System.arraycopy(encData, encPtr, result, HEADER_LEN_COMPRESSED, encLen); return new LZFChunk(result); }
/** * Factory method for constructing compressed chunk */ public static LZFChunk createCompressed(int origLen, byte[] encData, int encPtr, int encLen) { byte[] result = new byte[encLen + HEADER_LEN_COMPRESSED]; result[0] = BYTE_Z; result[1] = BYTE_V; result[2] = BLOCK_TYPE_COMPRESSED; result[3] = (byte) (encLen >> 8); result[4] = (byte) encLen; result[5] = (byte) (origLen >> 8); result[6] = (byte) origLen; System.arraycopy(encData, encPtr, result, HEADER_LEN_COMPRESSED, encLen); return new LZFChunk(result); }