uk.org.ogsadai.common
Class BlockReaderReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--uk.org.ogsadai.common.BlockReaderReader

public class BlockReaderReader
extends java.io.Reader

A java.io.Reader that wraps a uk.org.ogsadai.common.BlockReader.

The blocks contained in the BlockReader must be Strings, byte[] or implementations of the org.w3c.dom.Node interface.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  BlockReader mBlockReader
           
private  java.lang.StringBuffer mBuffer
           
private  boolean mOpen
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
BlockReaderReader(BlockReader blockReader)
          Constructs a new object that wraps the given BlockReader.
 
Method Summary
private  void appendNode(org.w3c.dom.Node node)
          Converts a block that is a Document Object Model org.w3c.dom.Node into a java.lang.String and add this to the internal buffer.
 void close()
           
 int read(char[] buffer, int offset, int length)
           
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mOpen

private boolean mOpen

mBlockReader

private final BlockReader mBlockReader

mBuffer

private final java.lang.StringBuffer mBuffer
Constructor Detail

BlockReaderReader

public BlockReaderReader(BlockReader blockReader)
Constructs a new object that wraps the given BlockReader.

Parameters:
blockReader - The BlockReader to wrap.
Method Detail

close

public void close()
Specified by:
close in class java.io.Reader

read

public int read(char[] buffer,
                int offset,
                int length)
         throws java.io.IOException
Specified by:
read in class java.io.Reader
java.io.IOException

appendNode

private void appendNode(org.w3c.dom.Node node)
Converts a block that is a Document Object Model org.w3c.dom.Node into a java.lang.String and add this to the internal buffer.

Parameters:
node - The Node to convert.