Closed GoogleCodeExporter closed 9 years ago
Original comment by kak@google.com
on 16 Apr 2013 at 5:57
Updated pull request with more idiomatic Guava code:
https://github.com/maginatics/guava-libraries/pull/2
One could also expose an infinite length non-zero stream which I use for
testing as well.
Original comment by g...@maginatics.com
on 22 Aug 2013 at 4:45
I made this utility method more generic and updated it for ByteSource:
/**
* @return an infinite-length ByteSource which repeats the contents of a
* byte array
*/
public static ByteSource repeatingArrayByteSource(final byte[] input) {
return ByteSource.concat(Iterables.cycle(ByteSource.wrap(input)));
}
Callers can use ByteSource.slice to make make input the desired size. The
implementation was not obvious to me and perhaps this is useful to others.
Original comment by g...@maginatics.com
on 27 Dec 2013 at 6:21
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:18
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
g...@maginatics.com
on 16 Apr 2013 at 5:54