2
FileInputStream中讀出方法簽名(是正確的術語?) -風格的FileInputStream的閱讀方法
public int read(byte[] b) throws IOException
// Reads up to b.length bytes of data from this input stream into an array of bytes. This method blocks until some input is available.
// Returns: the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached.
什麼是有過這樣的簽名這樣的優勢 -
public byte[] read(int numberOfBytes) throws IOException
// Reads up to numberOfBytes bytes of data from this input stream into an array of bytes.
// Returns- an array of bytes read. Array is empty if there is no more data because the end of the file has been reached.
後面的一個更方便嗎? – UnKnown 2016-03-29 09:01:44