本文介绍了阅读二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一个大的二进制文件拆分成两个二进制文件。我在二进制文件中有一个分隔符

(比如NewLine)。我需要拆分二进制文件,使得第一个文件到达NewLine,第二个文件来自NewLine,结束文件的
。请告知我这是否可能


谢谢

Rohith

I need to split a large binary file into two binary files. I have a delimiter
(say NewLine) in the binaryfile. I need to split the binary file such that
the first file is upto the NewLine and the Second file is from NewLine to end
of file. Kindly let me know whether this si possible

Thanks
Rohith

推荐答案




只需打开一个针对该文件的System.IO.FileStream。通过块[

将它读出来一个byte []并检查你的分隔符的块。把块子

写成第一个然后是一个seconde FileStream。


David



Just open a System.IO.FileStream against the file. Read it out by chunks
into a byte[] and examine the chunks for your delimeter. Write the chunks
to a first and then a seconde FileStream.

David




只需打开一个针对该文件的System.IO.FileStream。通过块读取它到一个字节[]并检查你的分隔符的块。把块打成
到第一个然后是一个seconde FileStream。

大卫



Just open a System.IO.FileStream against the file. Read it out by chunks
into a byte[] and examine the chunks for your delimeter. Write the chunks
to a first and then a seconde FileStream.

David




这篇关于阅读二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 02:09