I have a custom stream that I am using with WCF for large BLOBs from the database. It reads the data in chunks.
What is the best way to handle the connection for the stream? Should I just open it at the construction or open/close it with each chuck read?
Thanks.
...
I can save an image to the database streaming it to a byte array using the below code, but when it comes back out it has lost the alpha blending around the image and shows a blocky blue border.
image.Save(stream, image.RawFormat);
How can I get the original picture back out?
...
I seek an example of applying a regular expression to a Java I/O stream that doesn't simply convert the stream to a string as I would like to preserve binary data. Most of the examples on the Internet focus on text data...
...
In the boost examples in the documentation, tcp:iostream is used to very simply send streams over the network. In other examples write() is used to write data to the socket instead with a bit more code involved.
What is the difference between those 2 methods? Pros and cons? Is there something else that should be used instead ?
...
I want to develop a software which can record online radio streams in VC++ using MFC. Any pointers to get me started.
...
Hi, I quite recently learned about the C++ classes friend keyword and the uses in serialization and now I need some help in getting it to work.
I have no problem serializing my class to a file, it's working great, however i'm having a hard time trying to read this file into a vector container. I'm sure I need a loop in my code that read...
Consider the following Haskell program. I am trying to program in a "stream style" where functions operate on streams (implemented here simply as lists). Things like normalStreamFunc work great with lazy lists. I can pass an infinite list to normalStreamFunc and effectively get out another infinite list, but with a function mapped ont...
hello everyone
well, i am developing a single server multiple-client program in java. My problem is can i use single stream for all the clients or do i have to create a seperate stream for each client?
please help
thank you
...
I am looking for example code that demonstrates how to create a filter that understands binary data. Links to examples are greatly appreciated.
...
Hi,
how can I create std::ostream and std::istream objects to point to a piece of memory I allocated and manage (I don't want the stream to free my memory).
I was looking at using rdbuf()->pubsetbuf() to modify one of the other streams - say sstringstream. However I think streambuf used by stringstream will free the buffer afterwards?
...
I am working on a SSL client server program and I have to reuse the following method.
private boolean postMessage(String message){
try{
String serverURLS = getRecipientURL(message);
serverURLS = "https:\\\\abc.my.domain.com:55555\\update";
if (serverURLS != null){
serverURL = new URL(serverURLS);
...
The Scripting.FileSystemObject TextStream object supports Windows style Unicode and 'plain text' modified by the system codepage, but does not appear to support UTF8 -- However, it can actually stream files that are locked for updates, such as an IIS logfile.
ADODB.Stream supports UTF-8 (or raw binary), but will not "LoadFromFile" a fil...
In C++, to print a number in hexadecimal you do this:
int num = 10;
std::cout << std::hex << num; // => 'a'
I know I can create a manipulator that just adds stuff to the stream like so:
std::ostream& windows_feed(std::ostream& out)
{
out << "\r\n";
return out;
}
std::cout << "Hello" << windows_feed; // => "Hello\r\n"
Howev...
From reading a few questions and answers here, it seems that a telnet stream never really closes. Using DataAvailable() will not return.
I've inherited some code that took a very very long time to complete and we thought it was the telnet server that was the problem. However, there is a byte[32757] which the code tries to store the res...
Let's suppose that have a stream of text (or Reader in Java) that I'd like to check for a particular string. The stream of text might be very large so as soon as the search string is found I'd like to return true and also try to avoid storing the entire input in memory.
Naively, I might try to do something like this (in Java):
public b...
I'm working on a project for my company that uses a socket server (php) to gather data from a remote device. How can I make this perl program run directly on the stream instead of first having the server write to a tmp file then running this script on that file then writing out a csv file for insertion into a database?
I thought about ...
I've got a Java web service in JAX-WS that returns an OutputStream from another method. I can't seem to figure out how to stream the OutputStream into the returned DataHandler any other way than to create a temporary file, write to it, then open it back up again as an InputStream. Here's an example:
@MTOM
@WebService
class Example {
...
I am updating a website for a radio station and they would like to be able stream previously broadcast sports games on the site. Most games are 2 - 3 hours long so the files are really large. What would be the best way to offer these games so users can listen to them without having to download the file?
...
Hi,
This webservice expects this xml file:
request.FeedContent = File.Open("test.xml", FileMode.Open, FileAccess.Read);
I already have the file in a stream, but this statement hangs:
stream.Position = 0;
request.FeedContent = stream;
the stream is a standard .net MemoryStream
what operation do I do on the stream to make it the sa...
To redirect stdout in bash, overwriting file
cmd > file.txt
To redirect stdout in bash, appending to file
cmd >> file.txt
To redirect both stdout and stderr, overwriting
cmd &> file.txt
How do I redirect both stdout and stderr appending to file? cmd &>> file.txt does not work for me
...