Skip to content

Tag: stream

Understanding getInputStream and getOutputStream

Here is a code I have marked the statements that I have problems understanding. I do not understand what OutputStream object out will hold when it is assigned s.getOutputStream() and what is the need of passing buf to out by out.write(buf). I have learned Input and Output Streams using files but I do not unde…

platform-independent /dev/null output sink for Java

Other than an anonymous class (new OutputStream() { … }), can anyone suggest a moral equivalent of new FileOutputStream(“/dev/null”) that also works on Windows? In case someone’s wondering ‘what’s this for?’ I have a program that does a consistency analysis on a file.…

Listen to a shoutcast with Android

since quite some time I’m trying to listen to .pls files (shoutcasts). I have to say that I failed horrible. Since StreamFurious can do it it must be possible. First I tried to connect to the shoutcast via sockets (TCP and UDP) –> failed. I couldn’t even receive one byte from the server. …

Play WAV file backward

I’m making Braid in Java. If you rewind the time, the sound plays backward. How to play a WAV file backwards? Maybe with a stream with something like previous()? On the site of Braid can you see what I mean. Update: Solved! See my own post. Answer I solved it by myself And then:

Java Large Files Disk IO Performance

I have two (2GB each) files on my harddisk and want to compare them with each other: Copying the original files with Windows explorer takes approx. 2-4 minutes (that is reading and writing – on the same physical and logical disk). Reading with java.io.FileInputStream twice and comparing the byte arrays …