/** * Event is corrupted. Do recovery * * @return true if recovery could be performed and we can read more data * false is returned only when nothing more can be read */ private boolean performRecovery() throws TTransportException { int numChunks = getNumChunks(); int curChunk = cs.getChunkNum(); if(curChunk >= (numChunks-1)) { return false; } seekToChunk(curChunk+1); return true; }
/** * Event is corrupted. Do recovery * * @return true if recovery could be performed and we can read more data * false is returned only when nothing more can be read */ private boolean performRecovery() throws TTransportException { int numChunks = getNumChunks(); int curChunk = cs.getChunkNum(); if(curChunk >= (numChunks-1)) { return false; } seekToChunk(curChunk+1); return true; }
public void seekToEnd() throws TTransportException { if(!isOpen()) throw new TTransportException(TTransportException.NOT_OPEN, "Must open before seeking"); seekToChunk(getNumChunks()); }
public void seekToEnd() throws TTransportException { if(!isOpen()) throw new TTransportException(TTransportException.NOT_OPEN, "Must open before seeking"); seekToChunk(getNumChunks()); }
int cnum = r.nextInt(t.getNumChunks()-1); System.out.println("Reading chunk "+cnum); t.seekToChunk(cnum); for(int i=0; i<4096; i++) { t.read(buf, 0, 4096);
int cnum = r.nextInt(t.getNumChunks()-1); System.out.println("Reading chunk "+cnum); t.seekToChunk(cnum); for(int i=0; i<4096; i++) { t.read(buf, 0, 4096);
/** * Process from start to last chunk both inclusive where chunks begin from 0 * @param startChunkNum first chunk to be processed * @param endChunkNum last chunk to be processed */ public void processChunk(int startChunkNum, int endChunkNum) throws TException { int numChunks = inputTransport_.getNumChunks(); if(endChunkNum < 0) endChunkNum += numChunks; if(startChunkNum < 0) startChunkNum += numChunks; if(endChunkNum < startChunkNum) throw new TException("endChunkNum " + endChunkNum + " is less than " + startChunkNum); inputTransport_.seekToChunk(startChunkNum); processUntil(endChunkNum); }
/** * Process from start to last chunk both inclusive where chunks begin from 0 * @param startChunkNum first chunk to be processed * @param endChunkNum last chunk to be processed */ public void processChunk(int startChunkNum, int endChunkNum) throws TException { int numChunks = inputTransport_.getNumChunks(); if(endChunkNum < 0) endChunkNum += numChunks; if(startChunkNum < 0) startChunkNum += numChunks; if(endChunkNum < startChunkNum) throw new TException("endChunkNum " + endChunkNum + " is less than " + startChunkNum); inputTransport_.seekToChunk(startChunkNum); processUntil(endChunkNum); }