Java NIO總結(jié)

NIO是Java 1.4開始引入的侣肄,目的是替代標(biāo)準(zhǔn)IO蚜印,它采用了與標(biāo)準(zhǔn)IO完全不同的設(shè)計模式和工作方式,這里就來總結(jié)一下兴想。

1.Buffer

正如他的名字幢哨,就是一個緩存,實際上是內(nèi)存的一塊區(qū)域嫂便,它是NIO體系的重要組成部分捞镰,主要和通道進行交互。 Buffer本身是一個抽象類,它有以下幾個子類:
ByteBuffer
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
ShortBuffer
根據(jù)緩存的數(shù)據(jù)類型不同創(chuàng)建的不同子類岸售,大致功能都類似践樱,我們不一個一個介紹,只介紹Buffer的關(guān)鍵點凸丸。

Buffer的使用一般如下:將數(shù)據(jù)寫入buffer阳堕,準(zhǔn)備從buffer中讀數(shù)據(jù)弧可,讀取數(shù)據(jù)悼嫉,清空buffer萎馅。下面先簡單演示一下然后再解釋:

    public static void main(String[] args) throws IOException {
        try (RandomAccessFile file = new RandomAccessFile("file/test.txt","rw");
             FileChannel channel = file.getChannel()){
            ByteBuffer buffer = ByteBuffer.allocate(5);
            int len;
            while((len = channel.read(buffer))!=-1){
                buffer.flip();
                while (buffer.hasRemaining())
                    System.out.println((char)buffer.get());
                buffer.compact();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }

先看構(gòu)造,Buffer的子類也都是抽象類抛人,不能直接實例化,都需要調(diào)用靜態(tài)方法生成脐瑰,可以看源碼妖枚,調(diào)用不同的靜態(tài)方法實例化不同的實現(xiàn)類。以ByteBuffer為例苍在,可以這樣實例化:

allocate(int capacity) //分配一個大小為capacity的字節(jié)數(shù)組作為緩沖绝页,但是在堆中
allocateDirect(int capacity) //和上面類似,不過直接借助系統(tǒng)在內(nèi)存中創(chuàng)建寂恬,速度較快续誉,但消耗性能
wrap(byte[] array) //直接從外部指定一個數(shù)組,不適用默認(rèn)創(chuàng)建的初肉,但是雙方一方改動就會影響另一方
wrap(byte[] array, int offset, int length) //和上面一個一樣酷鸦,但是能指定偏移量和長度

我們獲得一個Buffer實例后就可以使用,首先向buffer中寫東西需要channel配合牙咏,調(diào)用read方法即可臼隔。之后在讀之前需要準(zhǔn)備一下,從代碼看就是調(diào)用flip方法妄壶,這個方法有什么作用呢摔握?從文檔上看,就是將limit設(shè)置為position丁寄,然后將position 置零氨淌。這樣有什么用呢?下面就來介紹一下buffer的幾個成員變量:capacity伊磺,limit盛正,position。

capacity就是一個buffer的固定大小奢浑,表示他的容量
position表示當(dāng)前指針的位置蛮艰,也就是當(dāng)前讀或?qū)懙降奈恢?br> limit這個值在寫模式下表示最多能寫多少,寫模式下等于capacity。讀模式下表示能讀到多少壤蚜,調(diào)用flip將limit等于position即寡,表示最多能讀到之前寫入的所有內(nèi)容

看flip的實現(xiàn)也很好理解,如下:

    public final Buffer flip() {
        limit = position;
        position = 0;
        mark = -1;
        return this;
    }

剛才是準(zhǔn)備讀數(shù)據(jù)袜刷,下面就是從中讀了聪富,buffer有一系列g(shù)et方法,和流的read方法類似著蟹。既然有g(shù)et就有put方法墩蔓,除了上面和channel配合寫入東西,還可以用一系列put方法寫入萧豆。讀之前可以判斷一下是否還有數(shù)據(jù):hasRemaining()奸披;讀完之后為了使下次還能用,需要清空buffer涮雷,可以用clear方法或者compact方法阵面。可以看一下他們的實現(xiàn):

    public final Buffer clear() {
        position = 0;
        limit = capacity;
        mark = -1;
        return this;
    }
    public ByteBuffer compact() {
        System.arraycopy(hb, ix(position()), hb, ix(0), remaining());
        position(remaining());
        limit(capacity());
        discardMark();
        return this;
    }

clear方法很清晰洪鸭,就是將幾個游標(biāo)歸為為原始狀態(tài)样刷。compact也是設(shè)置幾個游標(biāo)位置,不過有點特殊览爵,remaining方法是獲取剩余數(shù)據(jù)數(shù)量就是limit - position置鼻,然后將該值賦給position,然后將capacity賦值給limit蜓竹。他和clear的區(qū)別就是在position上的處理箕母。但是,如果我們已經(jīng)將buffer內(nèi)容讀完梅肤,這時limit = position司蔬,那么 position(remaining())的效果就是position = limit - position = 0.這時compact方法效果等于clear。否則雖然也可以繼續(xù)寫內(nèi)容進去姨蝴,但容量減少俊啼,但好處是未讀的數(shù)據(jù)以后可以繼續(xù)讀。

再來看其他方法:

    public final Buffer rewind() {
        position = 0;
        mark = -1;
        return this;
    }

rewind是將position 置零左医,也就是buffer中內(nèi)容可以重新讀取授帕。

    public final Buffer mark() {
        mark = position;
        return this;
    }
    public final Buffer reset() {
        int m = mark;
        if (m < 0)
            throw new InvalidMarkException();
        position = m;
        return this;
    }

mark和reset是配合使用的。mark標(biāo)記一個位置浮梢,reset使游標(biāo)回到這個位置跛十。mark成員變量初始為-1.所以不要沒有調(diào)用mark方法就去調(diào)用reset。

可以看到buffer的主要操作就是針對幾個指針的秕硝,畢竟他是依賴于數(shù)組實現(xiàn)的芥映。

2.Channel

Channel用來實現(xiàn)通道的概念,他類似于流,但是不能直接操作數(shù)據(jù)奈偏,需要借助于Buffer坞嘀,它本身是一個接口,一般有以下幾個重要實現(xiàn):
FileChannel
DatagramChannel
SocketChannel
ServerSocketChannel

2.1 FileChannel

FileChannel是一個用于讀寫操作文件的channel惊来。首先看怎么獲得實例化對象丽涩,F(xiàn)ileChannel也是一個抽象類,所以不能通過構(gòu)造獲得裁蚁。一般獲得的途徑有矢渊,RandomAccessFile、FileOutputStream枉证、FileInputStream等一些類的getChannel()方法,如上文中示例矮男。

另外在Java 1.7 中提供了幾個靜態(tài)的open方法用來直接打開或創(chuàng)建文件獲取Channel:

    public static void main(String[] args) throws IOException {
        try (FileChannel channel = FileChannel.open(Paths.get("file/test.txt"), StandardOpenOption.READ)){
            ByteBuffer buffer = ByteBuffer.allocate(5);
            int len;
            while((len = channel.read(buffer))!=-1){
                buffer.flip();
                while (buffer.hasRemaining())
                    System.out.println((char)buffer.get());
                buffer.compact();
            }

        }catch (Exception e){
            e.printStackTrace();
        }
    }

Channel是不能直接讀數(shù)據(jù)的,需要借助于buffer刽严,同樣寫內(nèi)容也是要借助于buffer昂灵,下面演示一下傳統(tǒng)的復(fù)制文件。

    public static void main(String[] args) throws IOException {
        try (FileChannel readChannel = FileChannel.open(Paths.get("file/test.png"), StandardOpenOption.READ)){
            FileChannel writeChannel = FileChannel.open(Paths.get("file/copy.png"), StandardOpenOption.READ,StandardOpenOption.WRITE,StandardOpenOption.CREATE);
            ByteBuffer buffer = ByteBuffer.allocate(1024);
            while (readChannel.read(buffer)!=-1){
                buffer.flip();
                while (buffer.hasRemaining())
                    writeChannel.write(buffer);
                buffer.clear();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }

有一點需要注意的是舞萄,有時并不能保證把整個buffer的內(nèi)容寫入,為了嚴(yán)謹(jǐn)起見管削,需要循環(huán)判斷buffer中是否有內(nèi)容未寫入倒脓。

除了上面?zhèn)鹘y(tǒng)的寫法,channel還有自己特有的傳輸方法:

        try (FileChannel readChannel = FileChannel.open(Paths.get("file/test.png"), StandardOpenOption.READ)){
            FileChannel writeChannel = FileChannel.open(Paths.get("file/copy.png"), StandardOpenOption.READ,StandardOpenOption.WRITE,StandardOpenOption.CREATE);
            //以下兩句話效果一樣
            //writeChannel.transferFrom(readChannel,0,readChannel.size());
            readChannel.transferTo(0,readChannel.size(),writeChannel);
        }catch (Exception e){
            e.printStackTrace();
        }

transferFrom和transferTo都是把一個channel的內(nèi)容傳輸?shù)搅硪粋€含思,但是注意兩個方法的區(qū)別崎弃,即方向性。

上面示例用到了size()方法含潘,是用來獲取所關(guān)聯(lián)文件的大小饲做。

position()和position(long)方法用來獲取指針位置和設(shè)置指針位置。設(shè)置position是可以將指針設(shè)置到文件結(jié)束符之后的遏弱,但是中間會有空洞盆均。

truncate(long)方法可一截取一個文件并返回FileChannel,從文件開始截取到指定位置漱逸。

2.2 DatagramChannel

DatagramChannel是Java UDP通信中傳輸數(shù)據(jù)的通道泪姨。關(guān)于Java中傳統(tǒng)UDP的實現(xiàn)見這里,下面簡單用DatagramChannel實現(xiàn)一下UDP通信
服務(wù)端

public class UDPService {
    public static final String SERVICE_IP = "127.0.0.1";

    public static final int SERVICE_PORT = 10101;

    public static void main(String[] args) {
        UDPService service = new UDPService();
        service.startService(SERVICE_IP,SERVICE_PORT);
    }

    private void startService(String ip, int port){
        try (DatagramChannel channel = DatagramChannel.open()){
            channel.bind(new InetSocketAddress(ip,port));
            while (true){
                ByteBuffer buffer = ByteBuffer.allocate(1024);
                SocketAddress socketAddress = channel.receive(buffer);
                String receive = new String(buffer.array(),"UTF-8").trim();
                System.out.println("address: " + socketAddress.toString()+ " msg: "+ receive);
                buffer.clear();
                buffer.put((receive + "hello world").getBytes());
                buffer.flip();
                channel.send(buffer,socketAddress);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

客戶端

public class UDPClient {

    public static void main(String[] args){
        UDPClient client = new UDPClient();
        Scanner scanner = new Scanner(System.in);
        while(true){
            String msg = scanner.nextLine();
            if("##".equals(msg))
                break;
            System.out.println(client.sendAndReceive(UDPService.SERVICE_IP,UDPService.SERVICE_PORT,msg));
        }
    }

    private String sendAndReceive(String serviceIp, int servicePort, String msg) {
        try (DatagramChannel channel = DatagramChannel.open()){
            ByteBuffer buffer = ByteBuffer.allocate(1024);
            buffer.put(msg.getBytes());
            System.out.println(buffer.position());
            buffer.flip();
            SocketAddress address = new InetSocketAddress(serviceIp,servicePort);
            System.out.println( channel.send(buffer,address));
            buffer.clear();
            SocketAddress socketAddress = channel.receive(buffer);
            return "address: " + socketAddress.toString()+ " msg: "+ new String(buffer.array(),"UTF-8");
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "null";
    }
}

一般獲得一個DatagramChannel 需要使用靜態(tài)方法open饰抒,DatagramChannel 也是配合buffer使用的肮砾。之后服務(wù)端需要綁定一個地址和端口。接下來就可以收發(fā)數(shù)據(jù)了袋坑,收用receive方法仗处,返回發(fā)送方的地址信息,發(fā)生使用send方法,返回成功發(fā)生的字節(jié)數(shù)婆誓。

有一點特別重要吃环,由于是配合buffer操作,無論是客戶端還是服務(wù)端旷档,在發(fā)送前都需要調(diào)用flip方法模叙,否則發(fā)送的都是空數(shù)據(jù)(因為都是從position到limit,flip之前position是當(dāng)前寫的位置鞋屈,limit為capacity)范咨。還有一點,在接受時厂庇,由于不知道buffer中有效字節(jié)數(shù)渠啊,所以limit為capacity,直觀的看就是轉(zhuǎn)為字符串時末尾有大量空內(nèi)容权旷,需要trim一下替蛉。

默認(rèn)情況下是阻塞的,也可以設(shè)置為非阻塞的拄氯,channel.configureBlocking(true);躲查,此時receive方法會立刻返回,可能為null译柏。channel也有connect方法镣煮,但是UDP是非連接的,所以只是綁定一個遠(yuǎn)端地址鄙麦,收發(fā)智能從指定地址來典唇。connect之后就可以用read或者write收發(fā)數(shù)據(jù)。

2.3 SocketChannel 與 ServerSocketChannel

這兩類是和Socket與 ServerSocket對應(yīng)的兩個雷胯府,也是專為TCP通信設(shè)計的介衔,ServerSocketChannel代表服務(wù)端,SocketChannel 代表一個連接骂因。關(guān)于Java的傳統(tǒng)TCP實現(xiàn)見這里炎咖,下面簡單實現(xiàn)一下TCP通信
服務(wù)端:

public class TCPService {
    public static final String SERVICE_IP = "127.0.0.1";

    public static final int SERVICE_PORT = 10101;

    public static void main(String[] args) {
        TCPService service = new TCPService();
        service.startService();
    }
    private void startService(){
        try (ServerSocketChannel service = ServerSocketChannel.open()){
            service.bind(new InetSocketAddress(SERVICE_IP,SERVICE_PORT));
            while (true){
                SocketChannel channel = service.accept();
                ByteBuffer buffer = ByteBuffer.allocate(1024);
                StringBuilder msg = new StringBuilder();
                while ((len = channel.read(buffer)) > 0) {
                    receive.append(new String(buffer.array(), 0, len));
                    buffer.clear();
                }
                System.out.println("address: " + channel.getRemoteAddress().toString() + " msg: " + msg.toString());

                buffer.clear();
                buffer.put((msg + "hello world").getBytes());
                buffer.flip();
                while (buffer.hasRemaining())
                    channel.write(buffer);
                channel.shutdownOutput();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

客戶端

public class TCPClient {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        TCPClient client = new TCPClient();
        while(true){
            System.out.println(client.sendAndReceive(TCPService.SERVICE_IP,TCPService.SERVICE_PORT,scanner.nextLine()));
        }
    }

    private String sendAndReceive(String address,int port,String msg){
        try (SocketChannel channel = SocketChannel.open()){
            channel.connect(new InetSocketAddress(address,port));
            ByteBuffer buffer = ByteBuffer.allocate(1024);
            buffer.put(msg.getBytes());
            buffer.flip();
            while (buffer.hasRemaining())
                channel.write(buffer);
            channel.shutdownOutput();
            buffer.clear();

            StringBuilder receive = new StringBuilder();
            int len = 0;
            while ((len = channel.read(buffer)) > 0) {
                receive.append(new String(buffer.array(), 0, len));
                buffer.clear();
            }
            return "address: " + channel.getRemoteAddress().toString() + " msg: " + receive.toString();
        }catch (Exception e){
            e.printStackTrace();
        }
        return "null";
    }
}

同樣都是利用open獲取一個示例,服務(wù)端要綁定地址和端口侣签,然后監(jiān)聽連接塘装,客戶端只需去連接服務(wù)端即可。同樣的都可以設(shè)置為非阻塞的影所,收發(fā)數(shù)據(jù)使用read和write方法蹦肴。需要注意的還是buffer操作問題以及即使關(guān)流或者做控制就行。

3.Selector

Selector 可以同時監(jiān)控多個Channel 的 IO 狀況猴娩,也就是說阴幌,利用 Selector可使一個單獨的線程管理多個 Channel勺阐,selector 是非阻塞 IO 的核心。簡單示例
客戶端

public class TCPClient {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        TCPClient client = new TCPClient();
        while(true){
            client.sendAndReceive(TCPService.SERVICE_IP,TCPService.SERVICE_PORT,scanner.nextLine());
        }
    }

    private void sendAndReceive(String address,int port,String msg){
        try (SocketChannel channel = SocketChannel.open()){
            channel.connect(new InetSocketAddress(address, port));
            ByteBuffer buf = ByteBuffer.allocate(1024);
            channel.configureBlocking(false);
            buf.put((new Date() + ":" + msg).getBytes());
            buf.flip();
            channel.write(buf);
            buf.clear();
            channel.shutdownOutput();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

服務(wù)端

public class TCPService {
    public static final String SERVICE_IP = "127.0.0.1";

    public static final int SERVICE_PORT = 10101;

    private String msg;

    public static void main(String[] args) {
        TCPService service = new TCPService();
        service.startService();
    }
    private void startService(){
        try (ServerSocketChannel service = ServerSocketChannel.open()){
            service.bind(new InetSocketAddress(SERVICE_IP,SERVICE_PORT));
            service.configureBlocking(false);
            Selector selector = Selector.open();
            service.register(selector, SelectionKey.OP_ACCEPT);
            while (selector.select() > 0) {
                Iterator<SelectionKey> it = selector.selectedKeys().iterator();
                while (it.hasNext()) {
                    SelectionKey key = it.next();
                    if (key.isAcceptable()) {
                        System.out.println("isAcceptable");
                        SocketChannel sc = service.accept();
                        sc.configureBlocking(false);
                        sc.register(selector, SelectionKey.OP_READ );
                    } else if (key.isReadable()) {
                        System.out.println("isReadable");
                        SocketChannel channel = (SocketChannel) key.channel();
                        ByteBuffer buf = ByteBuffer.allocate(1024);
                        int len = 0;
                        StringBuilder sb = new StringBuilder();
                        while ((len = channel.read(buf)) > 0) {
                            sb.append(new String(buf.array(), 0, len));
                            buf.clear();
                        }
                        System.out.println(sb.toString());
                        channel.close();
                    }
                    it.remove();
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}

主要是服務(wù)端的應(yīng)用矛双,基本流程就是先利用open()方法獲取一個Selector 渊抽,設(shè)置ServerSocketChannel 為非阻塞的,之后注冊事件议忽,一般有以下幾種

SelectionKey.OP_CONNECT
SelectionKey.OP_ACCEPT
SelectionKey.OP_READ
SelectionKey.OP_WRITE

之后調(diào)用select()返回就緒通道數(shù)懒闷,然后根據(jù)時間類型執(zhí)行具體操作即可。

4.Pipe

傳統(tǒng)IO為我們提供了線程間通信的類栈幸,PipedInputStream與PipedOutputStream愤估。NIO作為IO的替代者,自然也有線程通信的方法速址,就是Pipe玩焰,使用起來很簡單,如下:

public class Receiver extends Thread{
    private Pipe pipe;

    public void setPipe(Pipe pipe){
        this.pipe = pipe;
    }
    @Override
    public void run() {
        super.run();
        try (Pipe.SourceChannel channel = pipe.source()){
            ByteBuffer buf = ByteBuffer.allocate(1024);
            int len = 0;
            StringBuilder sb = new StringBuilder();
            while((len = channel.read(buf))!=-1){
                sb.append(new String(buf.array(),0,len));
                buf.clear();
            }
            System.out.println(sb.toString());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
public class Sender extends Thread{
    private Pipe pipe;

    public void setPipe(Pipe pipe){
        this.pipe = pipe;
    }
    @Override
    public void run() {
        super.run();
        try (Pipe.SinkChannel channel = pipe.sink()){
            ByteBuffer buffer = ByteBuffer.allocate(1024);
            buffer.put("hello world".getBytes());
            buffer.flip();
            while (buffer.hasRemaining())
                channel.write(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
    public static void main(String[] args) throws IOException {
        Receiver receiver = new Receiver();
        Sender sender = new Sender();
        Pipe pipe = Pipe.open();
        receiver.setPipe(pipe);
        sender.setPipe(pipe);
        receiver.start();
        sender.start();
    }

Pipe只是一個管理者芍锚,收發(fā)數(shù)據(jù)還是通過兩個通道:SinkChannel 和SourceChannel 昔园。都是單項的,SinkChannel 負(fù)責(zé)寫數(shù)據(jù)并炮,SourceChannel 負(fù)責(zé)收數(shù)據(jù)默刚。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市逃魄,隨后出現(xiàn)的幾起案子羡棵,更是在濱河造成了極大的恐慌,老刑警劉巖嗅钻,帶你破解...
    沈念sama閱讀 216,544評論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異店展,居然都是意外死亡养篓,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,430評論 3 392
  • 文/潘曉璐 我一進店門赂蕴,熙熙樓的掌柜王于貴愁眉苦臉地迎上來柳弄,“玉大人,你說我怎么就攤上這事概说”套ⅲ” “怎么了?”我有些...
    開封第一講書人閱讀 162,764評論 0 353
  • 文/不壞的土叔 我叫張陵糖赔,是天一觀的道長萍丐。 經(jīng)常有香客問我,道長放典,這世上最難降的妖魔是什么逝变? 我笑而不...
    開封第一講書人閱讀 58,193評論 1 292
  • 正文 為了忘掉前任基茵,我火速辦了婚禮,結(jié)果婚禮上壳影,老公的妹妹穿的比我還像新娘拱层。我一直安慰自己,他們只是感情好宴咧,可當(dāng)我...
    茶點故事閱讀 67,216評論 6 388
  • 文/花漫 我一把揭開白布根灯。 她就那樣靜靜地躺著,像睡著了一般掺栅。 火紅的嫁衣襯著肌膚如雪烙肺。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,182評論 1 299
  • 那天柿冲,我揣著相機與錄音茬高,去河邊找鬼。 笑死假抄,一個胖子當(dāng)著我的面吹牛怎栽,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播宿饱,決...
    沈念sama閱讀 40,063評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼熏瞄,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了谬以?” 一聲冷哼從身側(cè)響起强饮,我...
    開封第一講書人閱讀 38,917評論 0 274
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎为黎,沒想到半個月后邮丰,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,329評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡铭乾,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,543評論 2 332
  • 正文 我和宋清朗相戀三年剪廉,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片炕檩。...
    茶點故事閱讀 39,722評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡斗蒋,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出笛质,到底是詐尸還是另有隱情泉沾,我是刑警寧澤,帶...
    沈念sama閱讀 35,425評論 5 343
  • 正文 年R本政府宣布妇押,位于F島的核電站跷究,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏舆吮。R本人自食惡果不足惜揭朝,卻給世界環(huán)境...
    茶點故事閱讀 41,019評論 3 326
  • 文/蒙蒙 一队贱、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧潭袱,春花似錦柱嫌、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,671評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至彤悔,卻和暖如春嘉抓,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背晕窑。 一陣腳步聲響...
    開封第一講書人閱讀 32,825評論 1 269
  • 我被黑心中介騙來泰國打工抑片, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人杨赤。 一個月前我還...
    沈念sama閱讀 47,729評論 2 368
  • 正文 我出身青樓敞斋,卻偏偏與公主長得像,于是被迫代替她去往敵國和親疾牲。 傳聞我的和親對象是個殘疾皇子植捎,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,614評論 2 353

推薦閱讀更多精彩內(nèi)容