java - What to import to use IOUtils.toString()? -


i trying use ioutils.tostring() read file. however, getting error saying "ioutils cannot resolved."

what supposed importing allow me use function?

string = ioutils.tostring(inputstream); 

thanks

import org.apache.commons.io.ioutils;

if still can't import add pom.xml:

<dependency>     <groupid>commons-io</groupid>     <artifactid>commons-io</artifactid>     <version>2.5</version> </dependency> 

or direct jar/gradle etc visit: http://mvnrepository.com/artifact/commons-io/commons-io/2.5

also since version 2.5 of commons-io method ioutils.tostring(inputstream) has been deprecated. should use method encoding i.e.

ioutils.tostring(is, "utf-8"); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -