java中源代碼功能瞭解

datainput和dataoutput類的做用:java

java.io.DataInput  一句話歸納,從二進制流中讀取字節到緩存數組
從二進制流中轉化字節
讀取一些字節從輸入流中,存儲他們在緩存數組中,讀取的字節和長度相等(緩存的大小,將數據讀入到的緩存)
這個方法將會阻塞直到其中之一的條件發生:輸入數據的字節可用,正常的返回了;
文件的結尾被檢測到,這時會拋出EOFException;IOException,NULLPointException
java.io.DataOutput  primitive原始的
將java基本的數據類型轉化爲一系列的字節,並將這些字節寫入二進制流中
fraction  片斷apache

org.apache.hadoop.mapreduce.RecordReader
RecordReader 爲mapper將輸入數據分隔成key,value對數組


org.apache.hadoop.mapreduce.TaskAttemptContext;
TaskAttemptContext
The context for task attempts.緩存

 

org.apache.hadoop.mapreduce.lib.output.TextOutputFormat
TextOutputFormat :做用,寫普通的文本文件app


org.apache.hadoop.util.ReflectionUtilside

ReflectionUtils反射工具類工具

 

uri 分爲url和urn
url必定是uri,uri不必定是urloop

 

IO包this

java.io.Bits
功能:將原始的值壓縮或解壓到字節數組中;
java.io.BufferedInputStream
功能:將輸入的數據緩存到另外一個數組中
java.io.BufferedOutputStream
功能:將二進制數據寫入到新的輸出緩存
java.io.BufferedReader
功能:從輸入流中讀取文本,並緩存起來
   /**
     * Reads a single character.
     *
     * @return The character read, as an integer in the range
     *         0 to 65535 (<tt>0x00-0xffff</tt>), or -1 if the
     *         end of the stream has been reached
     * @exception  IOException  If an I/O error occurs
     */
    public int read() throws IOException {
        synchronized (lock) {
            ensureOpen();
            for (;;) {
                if (nextChar >= nChars) {
                    fill();
                    if (nextChar >= nChars)
                        return -1;
                }
                if (skipLF) {
                    skipLF = false;
                    if (cb[nextChar] == '\n') {
                        nextChar++;
                        continue;
                    }
                }
                return cb[nextChar++];
            }
        }
    }
A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage returnfollowed immediately by a linefeed.url

java.io.BufferedWriter

功能:將文本寫入字符輸出流中,緩存字符提供有效的寫字符,數組和字符串。
public BufferedWriter(Writer out, int sz) {
        super(out);
        if (sz <= 0)
            throw new IllegalArgumentException("Buffer size <= 0");
        this.out = out;
        cb = new char[sz];
        nChars = sz;
        nextChar = 0;

        lineSeparator = java.security.AccessController.doPrivileged(
            new sun.security.action.GetPropertyAction("line.separator"));
    }
java.io.ByteArrayInputStream
功能:建立流提供的字節數組,
nonnegative
adj.     非負的,正的,零的

java.io.ByteArrayOutputStream 功能:繼承了輸出流,數據寫到了字節數組中 byte array    

相關文章
相關標籤/搜索