/** * Cloned from TTransport.java:readAll(). Only difference is throwing an EOF exception * where one is detected. */ public int readAll(byte[] buf, int off, int len) throws TTransportException { int got = 0; int ret = 0; while (got < len) { ret = read(buf, off+got, len-got); if (ret < 0) { throw new TTransportException("Error in reading from file"); } if(ret == 0) { throw new TTransportException(TTransportException.END_OF_FILE, "End of File reached"); } got += ret; } return got; }
/** * Cloned from TTransport.java:readAll(). Only difference is throwing an EOF exception * where one is detected. */ public int readAll(byte[] buf, int off, int len) throws TTransportException { int got = 0; int ret = 0; while (got < len) { ret = read(buf, off+got, len-got); if (ret < 0) { throw new TTransportException("Error in reading from file"); } if(ret == 0) { throw new TTransportException(TTransportException.END_OF_FILE, "End of File reached"); } got += ret; } return got; }
t.seekToChunk(cnum); for(int i=0; i<4096; i++) { t.read(buf, 0, 4096);
t.seekToChunk(cnum); for(int i=0; i<4096; i++) { t.read(buf, 0, 4096);