play2-source-position-mappers/src/main/java/com/google/code/play2/spm/AbstractPlay2SourcePositionMapper.java
protected String readFileAsString( File file )
        throws IOException
    {
        FileInputStream is = new FileInputStream( file );
        try
        {
            byte[] buffer = new byte[8192];
            int len = is.read( buffer );
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            while ( len != -1 )
            {
                out.write( buffer, 0, len );
                len = is.read( buffer );
            }
            return charsetName != null ? new String( out.toByteArray(), charsetName ) : new String( out.toByteArray() );
        }
        finally
        {
            is.close();
        }
    }
protected String readFileAsString( File file )
        throws IOException
    {
        FileInputStream is = new FileInputStream( file );
        try
        {
            byte[] buffer = new byte[8192];
            int len = is.read( buffer );
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            while ( len != -1 )
            {
                out.write( buffer, 0, len );
                len = is.read( buffer );
            }
            return charsetName != null ? new String( out.toByteArray(), charsetName ) : new String( out.toByteArray() );
        }
        finally
        {
            is.close();
        }
    }
Reads the content of the file to a string.

@param file a file to read the content of
@return the content of the file
@throws IOException I/O exception when reading from the file