java中源代码的类_java中源代码功能了解

datainput和dataoutput类的作用:

java.io.DataInput  一句话概括,从二进制流中读取字节到缓存数组

从二进制流中转化字节

读取一些字节从输入流中,存储他们在缓存数组中,读取的字节和长度相等(缓存的大小,将数据读入到的缓存)

这个方法将会阻塞直到其中之一的条件发生:输入数据的字节可用,正常的返回了;

文件的结尾被检测到,这时会抛出EOFException;IOException,NULLPointException

java.io.DataOutput  primitive原始的

将java基本的数据类型转化为一系列的字节,并将这些字节写入二进制流中

fraction  片段

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 :作用,写普通的文本文件

org.apache.hadoop.util.ReflectionUtils

ReflectionUtils反射工具类

uri 分为url和urn

url一定是uri,uri不一定是url

IO包

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 (0x00-0xffff), 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.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值