Browsing 7239 questions and answers with Jon Skeet
It just means that the documentation of DataInput.readBoolean contains more detail. In particular, that documentation states: Reads one input byte and returns true if that byte is nonzero, false if that byte is zero. This method is... more 1/3/2015 6:59:36 PM
You shouldn't throw ArgumentNullException if the argument (recall) isn't null. Just ArgumentException is appropriate here when it's some problem with the argument other than it being null: if (recall == null) { throw new... more 1/2/2015 2:57:31 PM
You seem to be expecting that InputStream.read() will return 1 when it's reached the end of its content - it won't, it'll return -1. So your while loop should look like this: while((i=sis.read()) != -1) ... although you're still... more 1/2/2015 12:31:37 PM
You're making it far more complicated than you need to: DateTime dt = new DateTime(DateTimeZone.UTC); No conversion required at all. If you find you actually need to convert, you can use withZone. I'd suggest you avoid going via... more 1/2/2015 11:24:13 AM
Two problems: You can't use extension methods as if they were static methods of the extended type System.Decimal already has a Parse method, and the compiler always looks for "real" methods before extension methods. In fact, you can... more 1/2/2015 9:33:29 AM
You're using YYYY, which is the "ISO-8601 week year". That should almost always be used in conjunction with w, "week in year". You want yyyy to show the normal calendar year. The reason they're different is that the first ISO-8601 week of... more 1/2/2015 8:46:03 AM
or does Integer.ToString(int) inherently does culture invariant conversion? It does. The documentation isn't as clear as it might be, but it doesn't use any grouping separators, negative numbers are always prefixed with '-', and ASCII... more 1/2/2015 6:56:49 AM
You're not changing anything within your loop - so basically, on each iteration it will either increase Count or it won't, and it'll do the same thing each time - so Count will either be the length of the string, or it will be 0. The... more 1/2/2015 6:51:19 AM
The first approach I'd suggest is opening the path as a stream, and then use XDocument.Load(Stream). (There's a similar method for XElement, but I typically use XDocument when I'm loading a whole document, to make it clear that that's what... more 1/2/2015 6:46:04 AM
The problem pointed out in comments is a problem - you should define which encoding you want to use. I'd recommend using UTF-8, e.g. messageDigest.update(stringForHashCode.getBytes(StandardCharsets.UTF_8)); A bigger problem, however, is... more 1/1/2015 8:56:35 PM