How to use fileInputStream been set in build.gradle file

Hi Guys,

I am trying to initialize fileInputStream in build.gradle file as below.

run {
standardInput = new FileInputStream(stdin)
standardOutput = new FileOutputStream(stdout)
}

I am passing stdin variable while running gradle from command line.
Now, I want to use this standardInput in my Java class. Any idea how it can be done?