package com.testdatastream;
import java.io.* ;
public class Test {
/**
* @param args
* IO_ DataInputStream && DataOutputStream
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
DataOutputStream dos = new DataOutputStream(baos) ;
try {
dos.writeDouble(Math.random()) ; //读入随机产生的一个数
dos.writeBoolean(true) ;
System.out.println(dos.size()) ; //输出到目前为止写入此数据输出流的字节数
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()) ; //toByteArray()创建一个新分配的 byte 数组
System.out.println(bais.available()) ; //返回可从此输入流读取(或跳过)的剩余字节数
DataInputStream dis = new DataInputStream(bais) ;
System.out.println(dis.readDouble()) ; //先写入的必须先读出,不能先读Boolean
System.out.println(dis.readBoolean()) ;
dos.close() ;
dis.close() ;
} catch (IOException e) {
e.printStackTrace() ;
}
}
}
分享到:
相关推荐
本资源带有教程+工具,不会使用的里面有教程,主要解决EXE不能导入导出问题,不错的工具,所以才共享。独家拥有。
python库。 资源全名:fmu-dataio-0.7.1.tar.gz
Fundamentos_DataIO
data.io, 通过 socket.io 进行双向数据同步 data.io通过 Socket.IO 进行双向数据同步 示例在服务器上:var io = require('socket.io').listen(3000);var data = require('data.i
This is a matlab word format doucument, it contain almost all knowladge about Matlab data i/o ,use this document you can know Matlab data i/o quikly.
死亡项目。 dataio 是 C++ i/o 库,它以 CSV 格式提供流输入/输出,并带有可配置的列分隔符。 还支持win ini 之类的格式和二进制数据。 作者正计划在 sscilib 中重新实现 CVS/二进制输入/输出。
树莓派计算模块CM4官方IO底板手册
使用GetData.IO提取数据 获取机器学习的语义网络数据分三个步骤。 联系信息: GetData.IO随时准备为您提供帮助。如果您在使用该工具时遇到问题或从任何网站提取数据,请告诉我们。只需通过电子邮件在admin@getdata....
IO_Consolidation_in_the_Data_Center
intel-io-controller-hub-8-datasheet.pdf
IO Consolidation in the Data Center
您现在应该有一个名为:C:\Users\yourname\Documents\getdata-012\UCI HAR Dataset\ 将 run_analysis.R 复制到 C:\Users\yourname\Documents\getdata-012\UCI HAR Dataset\ 在 RStudio 中: setwd("C:\\Users\\...
资源分类:Python库 所属语言:Python 资源全名:cubicweb-dataio-0.6.1.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
super IO -83627 datasheet 详细介绍了83627的资源!
webRTCCopy, 一个使用 webRTC data.io的简单文件 webRTCCopyhttps://www.rtccopy.com使用库 https://raw.github.com/erbbysam/webRTC-data.io 创建即时/filesharing网站。 测试&在 Chr
High-speed Data Acquisition using the Linux Industrial IO framework
Python工具 该存储库包含通用但有用的python实用程序 隔片 命令行绘图程序。 例子 : 分隔位置.txt seplot position.txt color =红色position2.txt seplot averages.txt y ='A [:,1] -A [:,2]'dy ='A [:,3] / ...
You’ll learn the critical roles that data IO, linear algebra, statistics, data operations, learning and prediction, and Hadoop MapReduce play in the process. Throughout this book, you’ll find code ...
“tidyData.txt”中的整洁数据集作为附件上传到课程作业页面。 在这个数据集中,每个变量都有一列,每个观察值都是一行。 其余 3 个文件,README.md、CodeBook.md 和 run_analysis.R 上传到以下 Github 存储库: ...
LiveCycle Data Services 安装