• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to clip the file in java ??

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
Is there any way we can clip any file (viz audio,video,text) as per the user specific requirments. I mean if the total file size is of 10 MB and I want to clip the file in such a way that I will get 3 different files of sizes 3 MB , 3MB and 4 MB . Is it possible to achive this . What are those API through which I can play around with files.
Any link ,white paper will be appriciated
Regards
Samir
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the starting page for Sun's tutorial on Java IO.

Note that although it is easy to manipulate binary files with the java.io package classes, you can't arbitrarily cut image and audio files and still maintain the header information that tells applications how to treat them.

Bill
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot William
So in short there is no way we can randomly cut the files ...is that so ???
 
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you can if it's only for splitting so they fit on a floppy or something.

As soon as you're cutting movie or music files, then you have to do a lot more then just copying part of the source file.
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Rob,
yess....I am aware of the fact that lot of things needs to be done when we clip the file ....especially with the header portion .....
Do you know the specific API or package in java which id dedicated for the same.
Any white paper , link will be appreciated
Thanks and regards
Samir
 
Bartender
Posts: 9614
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since each file format will have its own unique properties, your best bet would be to search for a specific file format to find utilities that can be used to manipulate it.
Several image formats can be read and written by javax.imageio and resizing can be done with the standard Java API (again, search is your friend)
You could always use Runtime.exec() to spawn off external processes. In the Linux world we have some very useful utilities like lame, mplayer and imagemagick
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Joe for your kind help

Regards
Samir
 
    Bookmark Topic Watch Topic
  • New Topic