Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 401165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:00:33+00:00 2026-05-12T17:00:33+00:00

When reading zipfiles (using Java ZipInputStream or any other library) from an unknown source

  • 0

When reading zipfiles (using Java ZipInputStream or any other library) from an unknown source is there any way of detecting which entries are “character data” (and if so the encoding) or “binary data”. And, if binary, any way of determining any more information (MIME types, etc.)

EDIT does the ByteOrderMark (BOM) occur in zipentries and if so do we have to make special operations for it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:00:33+00:00Added an answer on May 12, 2026 at 5:00 pm

    It basically boils down to heuristics for determining the contents of files. For instance, for text files (ASCII) it should be possible to make a fairly good guess by checking the range of byte values used in the file — although this will never be completely fool-proof.

    You should try to limit the classes of file types you want to identify, e.g. is it enough to discern between “text data” and “binary data” ? If so you should be able to get a fairly high success rate for detection.

    For UNIX systems, there is always the file command which tries to identify file types based on (mostly) content.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading MSDN (and other sources) about custom report items (CRI) for reporting services 2005.
Reading through this question on multi-threaded javascript, I was wondering if there would be
Reading source code of sample projects, such as Beast and Bort, are recommended as
reading excel files from C# working well in 32 bit version server. It is
I'm using the following code, using the SharpZipLib library, to add files to a
I am using Powershell for some ETL work, reading compressed text files in and
Reading conflicting opinions on using SQL session state vs custom db table in MVC
I have some general questions regarding the java.util.zip library. What we basically do is
Creating this application has become a pain in the ass! Using Java I want
Reading the data the following way data<-read.csv(userStats.csv, sep=,, header=F) I tried to select an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.