2
* Copyright 1999,2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
18
package org.jboss.remoting.transport.coyote;
20
import java.io.IOException;
21
import java.io.InputStream;
24
* This class handles reading bytes.
26
* @author Remy Maucherat
27
* @author Jean-Francois Arcand
29
public class CoyoteInputStream
33
// ----------------------------------------------------- Instance Variables
36
protected InputBuffer ib;
38
// ----------------------------------------------------------- Constructors
41
protected CoyoteInputStream(InputBuffer ib)
46
// -------------------------------------------------------- Package Methods
57
// --------------------------------------------------------- Public Methods
61
* Prevent cloning the facade.
63
protected Object clone()
64
throws CloneNotSupportedException
66
throw new CloneNotSupportedException();
69
// --------------------------------------------- ServletInputStream Methods
78
public int available() throws IOException
80
return ib.available();
83
public int read(final byte[] b) throws IOException
85
return ib.read(b, 0, b.length);
89
public int read(final byte[] b, final int off, final int len)
92
return ib.read(b, off, len);
98
* Since we re-cycle, we can't allow the call to super.close()
99
* which would permantely disable us.
101
public void close() throws IOException