EMMA Coverage Report (generated Tue Dec 20 11:01:01 KST 2005)
[all classes][org.apache.mina.io.handler]

COVERAGE SUMMARY FOR SOURCE FILE [IoSessionOutputStream.java]

nameclass, %method, %block, %line, %
IoSessionOutputStream.java0%   (0/1)0%   (0/6)0%   (0/53)0%   (0/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class IoSessionOutputStream0%   (0/1)0%   (0/6)0%   (0/53)0%   (0/19)
IoSessionOutputStream (IoSession): void 0%   (0/1)0%   (0/6)0%   (0/3)
close (): void 0%   (0/1)0%   (0/5)0%   (0/2)
flush (): void 0%   (0/1)0%   (0/1)0%   (0/1)
write (byte []): void 0%   (0/1)0%   (0/11)0%   (0/4)
write (byte [], int, int): void 0%   (0/1)0%   (0/13)0%   (0/4)
write (int): void 0%   (0/1)0%   (0/17)0%   (0/5)

1/*
2 *   @(#) $Id: AbstractIoFilterChain.java 330415 2005-11-03 02:19:03Z trustin $
3 *
4 *   Copyright 2004 The Apache Software Foundation
5 *
6 *   Licensed under the Apache License, Version 2.0 (the "License");
7 *   you may not use this file except in compliance with the License.
8 *   You may obtain a copy of the License at
9 *
10 *       http://www.apache.org/licenses/LICENSE-2.0
11 *
12 *   Unless required by applicable law or agreed to in writing, software
13 *   distributed under the License is distributed on an "AS IS" BASIS,
14 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 *   See the License for the specific language governing permissions and
16 *   limitations under the License.
17 *
18 */
19package org.apache.mina.io.handler;
20 
21import java.io.OutputStream;
22 
23import org.apache.mina.common.ByteBuffer;
24import org.apache.mina.io.IoSession;
25 
26/**
27 * An {@link OutputStream} that forwards all write operations to
28 * the associated {@link IoSession}.
29 *
30 * @author The Apache Directory Project (dev@directory.apache.org)
31 * @version $Rev$, $Date$
32 *
33 */
34class IoSessionOutputStream extends OutputStream
35{
36    private final IoSession session;
37    
38    IoSessionOutputStream( IoSession session )
39    {
40        this.session = session;
41    }
42 
43    public void close()
44    {
45        session.close( true );
46    }
47 
48    public void flush()
49    {
50    }
51 
52    public void write( byte[] b, int off, int len )
53    {
54        ByteBuffer buf = ByteBuffer.wrap( b, off, len );
55        buf.acquire(); // prevent from being pooled.
56        session.write( buf, null );
57    }
58 
59    public void write( byte[] b )
60    {
61        ByteBuffer buf = ByteBuffer.wrap( b );
62        buf.acquire(); // prevent from being pooled.
63        session.write( buf, null );
64    }
65 
66    public void write( int b )
67    {
68        ByteBuffer buf = ByteBuffer.allocate( 1 );
69        buf.put( ( byte ) b );
70        buf.flip();
71        session.write( buf, null );
72    }
73}

[all classes][org.apache.mina.io.handler]
EMMA 2.0.4217 (C) Vladimir Roubtsov