Example #1
0
  private byte[] readByte(String f, long b, long t, boolean l)
      throws RemoteException, FttpException {
    FileAdapter fa = new FileAdapter(f);

    byte[] bts = null;
    try {
      if (l)
        bts =
            (b == -1 && t == -1)
                ? fa.getReader().readAllSafety()
                : fa.getReader(b, t).readAllSafety();
      else bts = (b == -1 && t == -1) ? fa.getReader().readAll() : fa.getReader(b, t).readAll();
    } catch (Exception e) {
      fa.close();
      throw FttpException.getNewException(e, fa);
    }
    fa.close();
    return bts;
  }
Example #2
0
  private int[] readInt(String f, long b, long t, boolean l) throws RemoteException, FttpException {
    FileAdapter fa = new FileAdapter(f);

    int[] its = null;
    try {
      if (l)
        its =
            (b == -1 && t == -1)
                ? fa.getIntReader().readIntAllSafety()
                : fa.getIntReader(b, t).readIntAllSafety();
      else
        its =
            (b == -1 && t == -1)
                ? fa.getIntReader().readIntAll()
                : fa.getIntReader(b, t).readIntAll();
    } catch (Exception e) {
      fa.close();
      throw FttpException.getNewException(e, fa);
    }
    fa.close();
    return its;
  }