java 1.6 compatibility - changed method setFixedLengthStreamingMode(long) to setFixedLengthStreamingMode(int)
warnings cleanup (imports, casts)