コード例 #1
0
  /**
   * Comprobar Tamaño del Fichero
   *
   * @param buf Un objeto Buffer con los datos.
   * @return lSize Tamaño del Fichero. 0 si hay un error
   */
  public static long parseFileSize(Buffer buf) throws IOException {
    long lFileSize = 0;
    try {
      // Obtener la longitud  del fichero...
      lFileSize = buf.getLong(8);

      // this.getFTP().insertStringJTextPane(" ","icono_entrada");
      // this.getFTP().insertStringJTextPane("Tamaño: "+lFileSize+newline,"entrada");

    } catch (ClusterNetInvalidParameterException e) {;
    } finally {
      return lFileSize;
    }
  }
コード例 #2
0
  /**
   * Recibir Tamaño del Fichero
   *
   * @return lSize Tamaño del Fichero
   */
  private long receiveFileSize() throws IOException {
    long lFileSize = 0;
    try {
      Buffer buf = new Buffer(8);

      // Obtener la longitud del nombre del fichero...
      this.id_socketIn.read(buf.getBuffer());

      lFileSize = buf.getLong(0);

      Log.log("Size: " + lFileSize + newline, "");
    } finally {
      return lFileSize;
    }
  }