2012-06-22 72 views

回答

1

在鏈接中給出的示例中,您發佈的有什麼不對?

// Later, read from the file using the file API 
     lock = false; // Let other people read at the same time 
     FileReadChannel readChannel = fileService.openReadChannel(file, false); 

    // Again, different standard Java ways of reading from the channel. 
     BufferedReader reader = new BufferedReader(Channels.newReader(readChannel, "UTF8")); 
     String line = reader.readLine(); 
    // line = "The woods are lovely dark and deep."