1 /* 2 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com 3 * The software in this package is published under the terms of the CPAL v1.0 4 * license, a copy of which has been included with this distribution in the 5 * LICENSE.txt file. 6 */ 7 package org.mule.module.pgp; 8 9 /** 10 * A {@link TransformPolicy} represents a policy that controls how {@link StreamTransformer} 11 * transform {@link LazyTransformedInputStream}. 12 * 13 * For instance, a policy would be transform all the bytes of the stream without waiting for some 14 * object to be requested. 15 */ 16 public interface TransformPolicy 17 { 18 /** 19 * Initialize this policy with the corresponding lazyTransformedInputStream 20 * 21 * @param lazyTransformedInputStream 22 */ 23 void initialize(LazyTransformedInputStream lazyTransformedInputStream); 24 25 /** 26 * Releases all the resources of this policy 27 */ 28 void release(); 29 30 /** 31 * Notifies this policy that the object has requested nroOfBytes 32 * 33 * @param nroOfBytes the nro of bytes requested by the object 34 */ 35 void readRequest(long nroOfBytes); 36 } 37 38