Bài giảng Công nghệ Java: Chương 8 - Trần Quang Diệu

Cùng nắm kiến thức trong chương này thông qua việc tìm hiểu các nội dung sau: Stream concepts, Input Streams, Output Streams, Reader, Writer, Object Serialization, Object Input, Stream Object, Output Stream,. | CÔNG NGHỆ JAVA CH8. JAVA INPUT/OUTPUT Quang Dieu Tran PhD 5/14/2020 6:23:20 AM INPUT/OUTPUT STREAMS Stream concepts Input Streams Output Streams Reader Writer Object Serialization Object Input Stream Object Output Stream 5/14/2020 6:23:20 AM Stream concepts Data exchange Data exchange type: Character, Object, voice, picture, audio, video. Program File Memory Network Program information 5/14/2020 6:23:20 AM Stream Stream: dòng thông tin giữa 2 tác nhân (mức cao) một dãy tuần tự các byte (mức thấp) Một stream được gắn với một nguồn (source), hay một đích (destination) Stream operations: open stream close stream read write seek Input stream: support reading functions Output stream: support writing functions Filter stream: buffer 5/14/2020 6:23:20 AM Hình 1: Chương trình xử lý dữ liệu từ 1 input stream Hình 2: Chương trình ghi dữ liệu ra output stream Input & Output Stream 5/14/2020 6:23:20 AM Trình tự đọc/ ghi dòng open input stream while (more information){ read information process information } close input stream open output stream while (more information){ get information from . write information } close output stream Đọc thông tin từ input stream Ghi thông tin vào output stream 5/14/2020 6:23:20 AM Các loại stream trong package các lớp trong gói được thiết kế gồm 2 nhóm chính: Nhóm input/output stream, hay nhóm hướng byte Nhóm reader/writer, hay nhóm hướng ký tự (unicode) 5/14/2020 6:23:20 AM Nhóm input/output stream Được gọi là nhóm hướng byte, vì thao tác đọc/ghi áp dụng cho 1 hoặc nhiều byte, chỉ giới hạn xử lý các byte 8 bits ISO-Latin-1. Rất thích hợp khi cần xử lý dữ liệu nhị phân như ảnh, âm thanh, binary files. Các input stream được mở rộng từ lớp InputStream (Abstract class) Các output stream được mở rộng từ lớp OutputStream (Abstract class) 5/14/2020 6:23:20 AM Nhóm input stream 5/14/2020 6:23:20 AM Nhóm output stream 5/14/2020 6:23:20 AM Nhóm reader/writer Được gọi là nhóm hướng ký tự, vì | CÔNG NGHỆ JAVA CH8. JAVA INPUT/OUTPUT Quang Dieu Tran PhD 5/14/2020 6:40:48 AM INPUT/OUTPUT STREAMS Stream concepts Input Streams Output Streams Reader Writer Object Serialization Object Input Stream Object Output Stream 5/14/2020 6:40:48 AM Stream concepts Data exchange Data exchange type: Character, Object, voice, picture, audio, video. Program File Memory Network Program information 5/14/2020 6:40:48 AM Stream Stream: dòng thông tin giữa 2 tác nhân (mức cao) một dãy tuần tự các byte (mức thấp) Một stream được gắn với một nguồn (source), hay một đích (destination) Stream operations: open stream close stream read write seek Input stream: support reading functions Output stream: support writing functions Filter stream: buffer 5/14/2020 6:40:48 AM Hình 1: Chương trình xử lý dữ liệu từ 1 input stream Hình 2: Chương trình ghi dữ liệu ra output stream Input & Output Stream 5/14/2020 6:40:48 AM Trình tự đọc/ ghi dòng open input stream while (more information){ read .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.