FileDocCategorySizeDatePackage
BufferedMessageInputStream.javaAPI DocExample3763Tue May 29 16:57:08 BST 2007com.sun.xml.ws.transport.tcp.io

BufferedMessageInputStream

public class BufferedMessageInputStream extends InputStream
author
Alexey Stashok

Fields Summary
private InputStream
inputStream
private boolean
isClosed
private boolean
isBuffered
private int
bufferedSize
Constructors Summary
public BufferedMessageInputStream(InputStream inputStream)

        this.inputStream = inputStream;
        isBuffered = false;
    
Methods Summary
public voidbufferMessage()

        if (!isBuffered) {
            final ByteArrayBuffer baBuffer = new ByteArrayBuffer();
            try {
                baBuffer.write(inputStream);
                inputStream = baBuffer.newInputStream();
                bufferedSize = baBuffer.size();
                isBuffered = true;
            } finally {
                baBuffer.close();
            }
        }
    
public voidclose()

        isClosed = true;
        inputStream.close();
    
public intgetBufferedSize()

        if (isBuffered) {
            return bufferedSize;
        }
        
        return 0;
    
public java.io.InputStreamgetSourceInputStream()

        return inputStream;
    
public booleanisBuffered()

        return isBuffered;
    
public booleanisClosed()

        return isClosed;
    
public intread()

        return inputStream.read();
    
public intread(byte[] b, int offset, int length)

        return inputStream.read(b, offset, length);