简体   繁体   English

有没有不用第三方库就可以创建tar文件的方法?

[英]Is there any way to create tar file without using third party libraries?

Can we create tar file without using third party libraries? 是否可以在不使用第三方库的情况下创建tar文件?

Thanks in advance. 提前致谢。

Regards, Sreenath Reddy 问候,斯雷纳斯·雷迪

There is no build-in support of the tar format in the standard library, no. 标准库中没有tar格​​式的内置支持。

But it is possible, yes. 但是有可能,是的。 The Wikipedia page about tar has a overview description of the format, and also links to more detailed descriptions (in the External links section). 有关tarWikipedia页面具有对该格式的概述,并且还链接到更详细的描述(在“外部链接”部分中)。 You should not need more to create a tar file with Java. 使用Java创建tar文件时,您不需要更多。 For convenience and performance, use a DataOutputStream on top of BufferedOutputStream and FileOutputStream (if you want to save this as a file). 为了方便起见和性能,请在BufferedOutputStream和FileOutputStream顶部使用DataOutputStream(如果要将其另存为文件)。

Of course, using an existing tar library is less error prone, easier to use and might even be faster. 当然,使用现有的tar库不太容易出错,更易于使用,甚至可能更快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java中的HttpClient而不使用任何第三方库 - Httpclient in java without using any third party libraries 我可以不使用任何第三方库来创建Web服务吗 - Can I create web services with out using any third party libraries 无需第三方库即可下载远程映像的最佳方法? - Best way to download remote images without third party libraries? 在没有第三方库的情况下读取CSV文件 - Reading CSV file without third-party libraries 有没有办法在不使用任何第三方应用程序的情况下以编程方式控制 android 中的充电? - Is there any way to control charging in android programatically without using any third party Apps? 如何在不使用第三方库的情况下使 recyclerview 可扩展 - How to make recyclerview Expandable without using third party libraries 使用带有netbeans的第三方库 - Using third party libraries with netbeans 如何在不使用第三方库的情况下使用Java中另一个CSV文件中的值创建CSV文件 - How to create a CSV file using the values from another CSV file in Java without using third party library 在OSGi环境中使用第三方JavaFX库 - Using third party JavaFX libraries in OSGi enviroment 如何在不使用第三方库的情况下转义java字符串中的unicode字符 - How to escape unicode characters in a java string without using third party libraries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM