Is there a way of reading a video file from your hard disk and storing it as a variable. I tryed googleing it but I keept getting stuff about reading the file and playing it at the same time. All I want to do is store it.
can I do this with ObjectInputStream()?
15 Replies - 731 Views - Last Post: 17 July 2012 - 02:36 PM
#1
Reading files from hardDisk and storing as variables?
Posted 16 July 2012 - 07:17 PM
Replies To: Reading files from hardDisk and storing as variables?
#2
Re: Reading files from hardDisk and storing as variables?
Posted 16 July 2012 - 08:28 PM
You aren't finding an obvious answer to this because you're trying to be too complicated, the closest you're going to get to this is storing it in an array and keeping a reference to that array around, however..
Its just going to eat a crapton of ram.
Its just going to eat a crapton of ram.
#3
Re: Reading files from hardDisk and storing as variables?
Posted 16 July 2012 - 08:36 PM
What do you want to do with this sound file, beyond saving it as a variable? What's this in aid of?
Any tutorial that shows you how to load a sound file and play it back will also show you how to load it and store it for later, but what do you want to do with the sound file once you have it?
Any tutorial that shows you how to load a sound file and play it back will also show you how to load it and store it for later, but what do you want to do with the sound file once you have it?
#4
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 08:30 AM
I am hoping to save it to a variable and then write that variable to the hard disk at a later date.
so it could become almost like a music or video library. I would probobly add a simple JFrame with a cupple buttons to interact with it and a JList to display them. I am planing to serialize the class at the end to store the library.
so it could become almost like a music or video library. I would probobly add a simple JFrame with a cupple buttons to interact with it and a JList to display them. I am planing to serialize the class at the end to store the library.
#6
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 08:40 AM
If you're just moving it around on the disk, just move the file around and don't worry about loading the content.
#7
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 09:02 AM
I don't quite understand how that zip thing works. Is it just writing a variable to a zip file?
are variables sored in ram because if this is true than do I need to find another way of doing this?
are variables sored in ram because if this is true than do I need to find another way of doing this?
#8
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 09:26 AM
I want to hold it in a way that it can not be read
#9
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 09:30 AM
May I ask why? Any modern tool to do this (iTunes, Windows Media Player, etc.), all hold the files in readable formats. If you serialize a bunch of video files, you will encounter OutOfMemoryErrors when unserializing them. Heck, you'll probably encounter them trying to even load the video files.
#10
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 09:41 AM
I want to hold it in a way that it can not be read.
#11
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 10:04 AM
I think you need to be more clear on what you're trying to build here.
We're assuming that you're talking about some ordinary use case, like a media player or something, and evidently that's wrong.
What exactly are you up to?
We're assuming that you're talking about some ordinary use case, like a media player or something, and evidently that's wrong.
What exactly are you up to?
#12
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 10:21 AM
Im sorry, I guess I have been rather unclear. I would like to make a bisic GUI so that allows me to select media files and create a unreadable data object from which this GUI can later go to and reconstruct the files.
#13
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 10:33 AM
Quote
I want to hold it in a way that it can not be read.
Yes. And I'm asking why is it important for the file not to be readable. Serialization really isn't the best way to accomplish this. It would be much better to actually encrypt the ZIP file than to serialize the Objects.
#14
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 10:37 AM
Courtney2012, on 17 July 2012 - 12:21 PM, said:
Im sorry, I guess I have been rather unclear. I would like to make a bisic GUI so that allows me to select media files and create a unreadable data object from which this GUI can later go to and reconstruct the files.
To what end? What purpose will this serve? When will I reach for this tool, and what will I be trying to accomplish?
#15
Re: Reading files from hardDisk and storing as variables?
Posted 17 July 2012 - 02:21 PM
let pretend that I own a small buisness and have confidential files that I don't want my staff to open. this would function to stop somone from being able to execute the given file or even beeing able to tell what type of file it is if they were to right click and look under properties.
|
|

New Topic/Question
Reply



MultiQuote






|