55 |
private static final int KNOWN_CSIZE = 2; |
private static final int KNOWN_CSIZE = 2; |
56 |
private static final int KNOWN_CRC = 4; |
private static final int KNOWN_CRC = 4; |
57 |
private static final int KNOWN_TIME = 8; |
private static final int KNOWN_TIME = 8; |
58 |
|
private static final int KNOWN_EXTRA = 16; |
59 |
|
|
60 |
private static Calendar cal; |
private static Calendar cal; |
61 |
|
|
187 |
{ |
{ |
188 |
if ((known & KNOWN_TIME) == 0) |
if ((known & KNOWN_TIME) == 0) |
189 |
return -1; |
return -1; |
190 |
|
|
191 |
|
// The extra bytes might contain the time (posix/unix extension) |
192 |
|
parseExtra (); |
193 |
|
|
194 |
int sec = 2 * (dostime & 0x1f); |
int sec = 2 * (dostime & 0x1f); |
195 |
int min = (dostime >> 5) & 0x3f; |
int min = (dostime >> 5) & 0x3f; |
196 |
int hrs = (dostime >> 11) & 0x1f; |
int hrs = (dostime >> 11) & 0x1f; |
321 |
this.extra = null; |
this.extra = null; |
322 |
return; |
return; |
323 |
} |
} |
|
|
|
324 |
if (extra.length > 0xffff) |
if (extra.length > 0xffff) |
325 |
throw new IllegalArgumentException(); |
throw new IllegalArgumentException(); |
326 |
this.extra = extra; |
this.extra = extra; |
327 |
|
} |
328 |
|
|
329 |
|
private void parseExtra() |
330 |
|
{ |
331 |
|
// Already parsed? |
332 |
|
if ((known & KNOWN_EXTRA) != 0) |
333 |
|
return; |
334 |
|
|
335 |
|
if (extra == null) |
336 |
|
{ |
337 |
|
known |= KNOWN_EXTRA; |
338 |
|
return; |
339 |
|
} |
340 |
|
|
341 |
try |
try |
342 |
{ |
{ |
343 |
int pos = 0; |
int pos = 0; |
368 |
/* be lenient */ |
/* be lenient */ |
369 |
return; |
return; |
370 |
} |
} |
371 |
|
|
372 |
|
known |= KNOWN_EXTRA; |
373 |
} |
} |
374 |
|
|
375 |
/** |
/** |