01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Alexander Y. Kleymenov
20: * @version $Revision$
21: */package org.apache.harmony.xnet.provider.jsse;
22:
23: /**
24: * This interface represents the ability of the
25: * classes to provide the chunks of data.
26: */
27: public interface DataStream {
28:
29: /**
30: * Checks if there is data to be read.
31: * @return true if there is the input data in the stream,
32: * false otherwise
33: */
34: public boolean hasData();
35:
36: /**
37: * Retrieves the data of specified length from the stream.
38: * If the data size in the stream is less than specified length,
39: * method returns all the data contained in the stream.
40: * @return byte array containing the demanded data.
41: */
42: public byte[] getData(int length);
43:
44: }
|