1 /* 2 3 Derby - Class org.apache.derby.iapi.services.io.StreamStorable 4 5 Licensed to the Apache Software Foundation (ASF) under one or more 6 contributor license agreements. See the NOTICE file distributed with 7 this work for additional information regarding copyright ownership. 8 The ASF licenses this file to you under the Apache License, Version 2.0 9 (the "License"); you may not use this file except in compliance with 10 the License. You may obtain a copy of the License at 11 12 http://www.apache.org/licenses/LICENSE-2.0 13 14 Unless required by applicable law or agreed to in writing, software 15 distributed under the License is distributed on an "AS IS" BASIS, 16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 See the License for the specific language governing permissions and 18 limitations under the License. 19 20 */ 21 22 package org.apache.derby.iapi.services.io; 23 import org.apache.derby.iapi.error.StandardException; 24 import java.io.InputStream; 25 26 /** 27 * Streaming interface for a data value. The format of 28 * the stream is data type dependent and represents the 29 * on-disk format of the value. That is it is different 30 * to the value an application will see through JDBC 31 * with methods like getBinaryStream and getAsciiStream. 32 * 33 * <BR> 34 * If the value is NULL (DataValueDescriptor.isNull returns 35 * true then these methods should not be used to get the value. 36 37 @see Formatable 38 */ 39 public interface StreamStorable 40 { 41 /** 42 Return the on-disk stream state of the object. 43 44 **/ 45 public InputStream returnStream(); 46 47 /** 48 sets the on-disk stream state for the object. 49 **/ 50 public void setStream(InputStream newStream); 51 52 /** 53 * Set the value by reading the stream and 54 * converting it to an object form. 55 * 56 @exception StandardException on error 57 **/ 58 public void loadStream() throws StandardException; 59 } 60