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    

相关文章
相关标签/搜索