private Object readChecksummedObject(ObjectInputStream is, long totalLength) throws IOException, ChecksumFailedException, ClassNotFoundException { InputStream ois = checker.checksumReaderWithLength(is, this.tempBucketFactory, totalLength); try { ObjectInputStream oo = new ObjectInputStream(ois); Object ret = oo.readObject(); oo.close(); oo = null; ois = null; return ret; } catch (Throwable t) { Logger.error(this, "Serialization failed: "+t, t); return null; } finally { if(ois != null) ois.close(); } }
private ClientRequest readRequestFromRecoveryData(ObjectInputStream is, long totalLength, RequestIdentifier reqID) throws IOException, ChecksumFailedException, StorageFormatException { InputStream tmp = checker.checksumReaderWithLength(is, this.tempBucketFactory, totalLength); try { DataInputStream dis = new DataInputStream(tmp); ClientRequest request = ClientRequest.restartFrom(dis, reqID, getClientContext(), checker); dis.close(); dis = null; tmp = null; return request; } catch (Throwable t) { Logger.error(this, "Serialization failed: "+t, t); return null; } finally { if(tmp != null) tmp.close(); } }
try { DataInputStream innerDIS = new DataInputStream(checker.checksumReaderWithLength(dis, context.tempBucketFactory, 65536)); try { fctx = new FetchContext(innerDIS); try { DataInputStream innerDIS = new DataInputStream(checker.checksumReaderWithLength(dis, context.tempBucketFactory, 65536)); try { returnBucketDirect = BucketTools.restoreFrom(innerDIS, context.persistentFG, context.persistentFileTracker, context.getPersistentMasterSecret()); try { DataInputStream innerDIS = new DataInputStream(checker.checksumReaderWithLength(dis, context.tempBucketFactory, 65536)); try { getFailedMessage = new GetFailedMessage(innerDIS, reqID, foundDataLength, foundDataMimeType); try { DataInputStream innerDIS = new DataInputStream(checker.checksumReaderWithLength(dis, context.tempBucketFactory, 65536)); try { if(getter.resumeFromTrivialProgress(innerDIS, context)) {
throw new StorageFormatException("Bad checksum type"); InputStream is = checker.checksumReaderWithLength(ois, new ArrayBucketFactory(), 1024*1024); dis = new DataInputStream(is); int version = dis.readInt(); crossSegments = null; is = checker.checksumReaderWithLength(ois, new ArrayBucketFactory(), 1024*1024); dis = new DataInputStream(is); if(hasPaddedLastBlock) { is = checker.checksumReaderWithLength(ois, new ArrayBucketFactory(), 1024*1024); dis = new DataInputStream(is); long blocks = 0; throw new StorageFormatException("Total data blocks should be "+totalDataBlocks+" but is "+blocks); if(crossSegments != null) { is = checker.checksumReaderWithLength(ois, new ArrayBucketFactory(), 1024*1024); dis = new DataInputStream(is); for(int i=0;i<crossSegments.length;i++) { dis = new DataInputStream(checker.checksumReaderWithLength(ois, new ArrayBucketFactory(), 1024*1024)); errors = new FailureCodeTracker(true, dis); dis.close();