VCDiffCodeTableWriterImpl implements com.davidehrmann.vcdiff.VCDiffCodeTableWriter<OutputStream> { public void add(byte[] data, int offset, int length) { if (offset + length > data.length || length < 0) { throw new IllegalArgumentException(); } encodeInstruction(VCDiffCodeTableData.VCD_ADD, length); dataForAddAndRun.put(data, offset, length); targetLength += length; } VCDiffCodeTableWriterImpl(boolean interleaved);   VCDiffCodeTableWriterImpl(boolean interleaved, short nearCacheSize, short sameCacheSize, VCDiffCodeTableData codeTableData, short maxMode); void init(int dictionarySize); void add(byte[] data, int offset, int length); void addChecksum(int checksum); void copy(int offset, int size); void finishEncoding(OutputStream out); int getDeltaWindowSize(); void output(OutputStream out); void run(int size, byte b); void writeHeader(OutputStream out, EnumSet<VCDiffFormatExtension> formatExtensions); int targetLength();  }
@Test(expected = IllegalStateException.class) public void WriterAddWithoutInit() { standard_writer.add("Hello".getBytes(US_ASCII), 0, 5); }