// $Id$
//
// Copyright 2007-2008 Cisco Systems Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
namespace Etch.Util
{
public interface InputStream
{
///
/// Returns the number of bytes that can be read (or skipped over)
/// from this input stream without blocking by the next caller of a
/// method for this input stream.
///
///
int Available();
///
/// Closes this input stream and releases any system resources
/// associated with the stream.
///
void Close();
///
/// Reads the next byte of data from the input stream.
///
/// the next byte of data, or -1 if the end of
/// the stream is reached.
int Read();
///
/// Reads some number of bytes from the input stream and stores them
/// into the buffer array b.
///
/// the buffer into which the data is read.
/// the total number of bytes read into the buffer, or -1 is
/// there is no more data because the end of the stream has been reached.
int Read(byte[] buf);
///
/// Reads up to len bytes of data from the input stream into an array of bytes.
///
/// the buffer into which the data is read.
/// the start offset in array b at which the data is written.
/// the maximum number of bytes to read.
/// the total number of bytes read into the buffer, or -1 if there is no more
/// data because the end of the stream has been reached.
int Read(byte[] b, int off, int len);
}
}