public static AuthTime readFrom(SeekableByteChannel chan) throws IOException {
  String client=readStringWithLength(chan);
  String server=readStringWithLength(chan);
  ByteBuffer bb=ByteBuffer.allocate(8);
  chan.read(bb);
  bb.order(ByteOrder.nativeOrder());
  int cusec=bb.getInt(0);
  int ctime=bb.getInt(4);
  if (client.isEmpty()) {
    StringTokenizer st=new StringTokenizer(server," :");
    if (st.countTokens() != 6) {
      throw new IOException("Incorrect rcache style");
    }
    st.nextToken();
    String hash=st.nextToken();
    st.nextToken();
    client=st.nextToken();
    st.nextToken();
    server=st.nextToken();
    return new AuthTimeWithHash(client,server,ctime,cusec,hash);
  }
 else {
    return new AuthTime(client,server,ctime,cusec);
  }
}

public static AuthTime readFrom ( SeekableByteChannel chan ) throws IOException { String client = readStringWithLength ( chan ) ; String server = readStringWithLength ( chan ) ; ByteBuffer bb = ByteBuffer . allocate ( 8 ) ; chan . read ( bb ) ; bb . order ( ByteOrder . nativeOrder ( ) ) ; int cusec = bb . getInt ( 0 ) ; int ctime = bb . getInt ( 4 ) ; if ( client . isEmpty ( ) ) { StringTokenizer st = new StringTokenizer ( server , " :" ) ; if ( st . countTokens ( ) != 6 ) { throw new IOException ( "Incorrect rcache style" ) ; } st . nextToken ( ) ; String hash = st . nextToken ( ) ; st . nextToken ( ) ; client = st . nextToken ( ) ; st . nextToken ( ) ; server = st . nextToken ( ) ; return new AuthTimeWithHash ( client , server , ctime , cusec , hash ) ; } else { return new AuthTime ( client , server , ctime , cusec ) ; } }
reads an authtime or authtimewithhash object from a channel .
