Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the << operator?

Tags:

groovy

Just trying to understand a line of code which copies a file:

new File("c:\\test") << new File("c:\\test\\newtest").bytes

What is the << known as ?

like image 268
blue-sky Avatar asked Dec 03 '25 02:12

blue-sky


1 Answers

It's the left shift operator

That line of code is calling File.leftShift( byte[] bytes ) (documentation here), so is writing the bytes from newtest into test

like image 187
tim_yates Avatar answered Dec 06 '25 00:12

tim_yates



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!