siglib -- A Java Toolbox
You know that code you’ve written over, and over, and over, and over again? The code that you end up using on every project, but no one has put in one place to carry around with you?
Well, this is a library of exactly that code for Java. It’s the parts of the library that everyone knows are missing but no one talks about.
siglib is the code that I’m tired of writing over and over — Array utility methods, IO utility classes, etc. — and I’m now putting into one library so when I start a new project I can get to work instead of rewriting this stuff one more time.
For example, to read in the contents of a file as a String, use:
String contents=IOUtil.slurp(new FileReader("/path/to/file"));
After the method returns, contents contains the file’s contents as a String, and the FileReader is closed. To get the contents of the file as an array of bytes, use this instead:
byte[] contents=IOUtil.slurp(new FileInputStream("/path/to/file"));
…Just change the type of the input to IOUtil.slurp(), and siglib takes care of the rest.
siglib is released under the Apache 2.0 license, which means you can use it pretty much any which way you want as long as you don’t claim you wrote it. Enjoy! And I hope you find it useful.
| Link | Date | Changes |
|---|---|---|
| version 1.0 Beta 1 (source) | August 24, 2010 | Initial Release. |


