code: public long length() throws IOException {
          try {
              return Libcore.os.fstat(fd).st_size;
          } catch (ErrnoException errnoException) {
              throw errnoException.rethrowAsIOException();
          }
      }
docs: Returns the length of this file in bytes.
  
  @return the file's length in bytes.
  @throws IOException
  if this file is closed or some other I/O error occurs.