public void open( boolean readOnly )
	throws ReadOnlyException,
	       IOException {

	// Resource cann be double-opened!
	if( this.isOpen() ) 
	    throw new IOException( "Processable resources cannot be double opened." );

	if( !readOnly )
	    throw new ReadOnlyException( "This BufferedResource implementation only supports read-only access." );

	
	// Read the complete data from the input stream into the byte buffer
	ByteArrayOutputStream byteOut = new ByteArrayOutputStream( 1024 );  // add initial buffer size as constructor param?
	byte[] buffer = new byte[ 1024 ]; // Use different buffer sizes?
	int length;


	// Note: InputStream.read(byte[]) returns -1 as soon as EOF is reached.
	while( (length = this.in.read(buffer)) > 0 ) {

	    //for( int i = 0; i < length; i++ )
	    //System.out.print( (char)buffer[i] );
	    
	    // Push data into ByteArrayOutputStream
	    byteOut.write( buffer, 0, length );

	}

	// Finally 'convert' the ByteOutputStream into a ByteArrayResource
	this.byteArrayResource = new ByteArrayResource( this.getHTTPHandler(),
							this.getLogger(), 
							byteOut.toByteArray(),
							false    // It is not necessary to use fair locks here because this wrapped Resource is private
							);
	byteOut.close();

	// Don't forget the underlying Resource, too!
	this.byteArrayResource.open( true );  // Open in readOnly mode (the whole implementation is read-only)

	// Done. Do NOT close input stream (that is the task of the instance which opened it!)

    }