01: /*
02:
03: Derby - Class org.apache.derby.iapi.services.io.StreamStorable
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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:
24: import org.apache.derby.iapi.error.StandardException;
25: import java.io.InputStream;
26:
27: /**
28: * Streaming interface for a data value. The format of
29: * the stream is data type dependent and represents the
30: * on-disk format of the value. That is it is different
31: * to the value an application will see through JDBC
32: * with methods like getBinaryStream and getAsciiStream.
33: *
34: * <BR>
35: * If the value is NULL (DataValueDescriptor.isNull returns
36: * true then these methods should not be used to get the value.
37:
38: @see Formatable
39: */
40: public interface StreamStorable {
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: }
|