23(java/io/data_io)

Posted ACM_ICPCER

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了23(java/io/data_io)相关的知识,希望对你有一定的参考价值。

package test_ppt;
import java.io.*;
public class test_ppt
{
public static void main(String args[]) throws IOException
{
FileOutputStream fos = new FileOutputStream("a.txt");
DataOutputStream dos = new DataOutputStream (fos);
try
{//ff
dos.writeBoolean(true);
dos.writeByte((byte)123);
dos.writeChar(‘J‘);
dos.writeDouble(3.141592654);
dos.writeFloat(2.7182f);
dos.writeInt(1234567890);
dos.writeLong(998877665544332211L);
dos.writeShort((short)11223);
}
finally
{
dos.close();
}
FileInputStream fis = new FileInputStream("a.txt");
DataInputStream dis = new DataInputStream(fis);
try
{
System.out.println("\t "+dis.readBoolean());
System.out.println("\t "+dis.readByte());
System.out.println("\t "+dis.readChar());
System.out.println("\t "+dis.readDouble());
System.out.println("\t "+dis.readFloat());
System.out.println("\t "+dis.readInt());
System.out.println("\t "+dis.readLong());
System.out.println("\t "+dis.readShort());
}
finally
{
dis.close();
}
}//main()
}//class DataStream










































以上是关于23(java/io/data_io)的主要内容,如果未能解决你的问题,请参考以下文章

2021-06-23

json pickle 模块

Azure SQL Database (23) Azure SQL Database Dynamic Data Masking动态数据掩码

data

lua处理小数

Mysql中的DATE_FORMAT(data, format)