1 // Copyright 2016 Google Inc. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package com.google.archivepatcher.applier; 16 17 import java.io.File; 18 import java.io.IOException; 19 import java.io.InputStream; 20 import java.io.OutputStream; 21 22 /** 23 * An interface to be implemented by delta appliers. 24 */ 25 public interface DeltaApplier { 26 /** 27 * Applies a delta from deltaIn to oldBlob and writes the result to newBlobOut. 28 * 29 * @param oldBlob the old blob 30 * @param deltaIn the delta to apply to the oldBlob 31 * @param newBlobOut the stream to write the result to 32 * @throws IOException in the event of an I/O error reading the input or writing the output 33 */ applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut)34 public void applyDelta(File oldBlob, InputStream deltaIn, OutputStream newBlobOut) 35 throws IOException; 36 } 37