~ubuntu-branches/ubuntu/raring/libjboss-remoting-java/raring

« back to all changes in this revision

Viewing changes to src/org/jboss/remoting/transport/coyote/CoyoteInputStream.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-09 14:01:03 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: package-import@ubuntu.com-20110909140103-hqokx61534tas9rg
Tags: 2.5.3.SP1-1
* Newer but not newest upstream release. Do not build samples.
* Change debian/watch to upstream's svn repo.
* Add patch to fix compile error caused by tomcat update.
  (Closes: #628303)
* Switch to source format 3.0.
* Switch to debhelper level 7.
* Remove useless Depends.
* Update Standards-Version: 3.9.2.
* Update README.source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 1999,2004 The Apache Software Foundation.
3
 
 *
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
7
 
 *
8
 
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 
 *
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.
15
 
 */ 
16
 
 
17
 
 
18
 
package org.jboss.remoting.transport.coyote;
19
 
 
20
 
import java.io.IOException;
21
 
import java.io.InputStream;
22
 
 
23
 
/**
24
 
 * This class handles reading bytes.
25
 
 *
26
 
 * @author Remy Maucherat
27
 
 * @author Jean-Francois Arcand
28
 
 */
29
 
public class CoyoteInputStream
30
 
      extends InputStream
31
 
{
32
 
 
33
 
   // ----------------------------------------------------- Instance Variables
34
 
 
35
 
 
36
 
   protected InputBuffer ib;
37
 
 
38
 
   // ----------------------------------------------------------- Constructors
39
 
 
40
 
 
41
 
   protected CoyoteInputStream(InputBuffer ib)
42
 
   {
43
 
      this.ib = ib;
44
 
   }
45
 
 
46
 
   // -------------------------------------------------------- Package Methods
47
 
 
48
 
 
49
 
   /**
50
 
    * Clear facade.
51
 
    */
52
 
   void clear()
53
 
   {
54
 
      ib = null;
55
 
   }
56
 
 
57
 
   // --------------------------------------------------------- Public Methods
58
 
 
59
 
 
60
 
   /**
61
 
    * Prevent cloning the facade.
62
 
    */
63
 
   protected Object clone()
64
 
         throws CloneNotSupportedException
65
 
   {
66
 
      throw new CloneNotSupportedException();
67
 
   }
68
 
 
69
 
   // --------------------------------------------- ServletInputStream Methods
70
 
 
71
 
 
72
 
   public int read()
73
 
         throws IOException
74
 
   {
75
 
      return ib.readByte();
76
 
   }
77
 
 
78
 
   public int available() throws IOException
79
 
   {
80
 
      return ib.available();
81
 
   }
82
 
 
83
 
   public int read(final byte[] b) throws IOException
84
 
   {
85
 
      return ib.read(b, 0, b.length);
86
 
   }
87
 
 
88
 
 
89
 
   public int read(final byte[] b, final int off, final int len)
90
 
         throws IOException
91
 
   {
92
 
      return ib.read(b, off, len);
93
 
   }
94
 
 
95
 
 
96
 
   /**
97
 
    * Close the stream
98
 
    * Since we re-cycle, we can't allow the call to super.close()
99
 
    * which would permantely disable us.
100
 
    */
101
 
   public void close() throws IOException
102
 
   {
103
 
      ib.close();
104
 
   }
105
 
 
106
 
}