I am receiving an XML via an HttpPost to my service, and I want to log the received value for debugging purposes.
First I deserialize it into an entity like this:
XmlSerializer s = new XmlSerializer(typeof(TransactionResults));
TransactionResults t = (TransactionResults)s.Deserialize(stream);
This, of course, moves the stream to the...
A PipedInputStream/PipedOutputStream connection works great when the data only needs to be piped to one output, but if multiple output streams are connected to one input stream, the data becomes fragmented across the different outputs. My current solution involves having a threaded "reader" that reads data from an InputStream and then w...
Today I've got an problem with an ObjectStream (Input and also Output).
I used the Input and OutputStream which came directly out of the socket.
While initialising the streams my runs and runs and runs. With no error message.
I got no error message.
It seems that the constructor of the ObjectInputStream runs endless...
Here is the code...
Hi, I had the following situtation, I'm reading and parsing some packets from the network within a separated thread (not the main thread).
After this, I'm trying to put them into a CFWriteStreamRef (created using CFStreamCreateBoundPair, in order to get a CFReadStreamRef that could be able to read the bytes from the writer stream) in a ...
Hi Folks,
I am new to C, and want to read some data from a file.
Actually, I find many reading functions, fgetc, fgets, etc..
But I don't know which one/combination is the best to read a file with the following format:
0 1500 100.50
1 200 9
2 150 10
I just need to save each row above into a struct with three data members.
I...
I have the following code (simplified):
ostringstream oss;
oss << "Text ";
oss << hex << uppercase;
oss.width(8);
oss.fill('0');
oss << var1 << " ";
oss << var2 << " ";
oss << dec << nouppercase;
oss.width(1);
oss << var3 << " another text." << endl;
string result = oss.str();
// work with result...
Where var1, var2 are unsigned...
How should I really go about implementing the following? I will have to handle a byte array that will contain text on several lines. The average size of the data is probably going to be around 10 kilobytes of data.
After unspecified amount of lines there will be a line starting with special token ("FIRSTSTRING"). Later somewhere on the...
I'm trying to read an entire stream (multiple lines) into a string.
I'm using this code, and it works, but it's offending my sense of style... Surely there's an easier way? Maybe using stringstreams?
void Obj::loadFromStream(std::istream & stream)
{
std::string s;
int p = stream.tellg(); // remember where we are
stream.seekg...
Typically I declare streams inside of a using statement to ensure that the stream is properly disposed when I am done with it, and so that I don't mistakenly call it when I'm outside the using block.
Some examples here:
MSDN using Statement Reference
How does one use a using statement with an array of streams?
Would it be equivalent to...
Hey,
I do have a program (call it "a.exe" for example) which reads its config from several files.
can I write another program to redirect all file accesses of "a.exe" to another stream (console for example)?
I don't have the code of "a.exe" but if I get the source code of a.exe, obviously I can change all the file accesses. but is ther...
Possible Duplicate:
Are there binary memory streams in C++
Oops - http://stackoverflow.com/questions/1559254/are-there-binary-memory-streams-in-c
...
I'm writing an application that creates catalogs of files. Currently the catalog information is stored in an XML file, but I'm trying to abstract the interface to a catalog to allow for other future storage mechanisms such as a single ZIP file, SQL server, or HTTP server. So rather than returning a file path the abstract Catalog class re...
I'm fairly new to BizTalk and creating a custom pipeline component. I have seen code in examples that are similar to the following:
public void Disassemble(IPipelineContext pContext, IBaseMessage pInMsg)
{
Stream originalDataStream = pInMsg.BodyPart.GetOriginalDataStream();
StreamReader strReader = new StreamReader(originalDat...
I'm experimenting with a little web framework and stumbled across an issue with streams. There are handler methods like Response get(HttpServletRequest). From the frameworks perspective the response should offer an input stream for the response body. The framework reads this streams and writes the data to the underlying OutputStream of t...
I'm attempting to create an infinite stream of strings from readLine calls:
import java.io.{BufferedReader, InputStreamReader}
val in = new BufferedReader(new InputStreamReader(System in))
val input: Stream[String] = Stream.cons(in readLine, input)
But it appears that the readLine call isn't being called lazily. Immediately after ente...
I have a templatized container class in C++ which is similar to a std::map (it's basically a thread-safe wrapper around the std::map). I'd like to write a member function which dumps information about the entries in the map. Obviously, however, I don't know the type of the objects in the map or their keys. The goal is to be able to ha...
Hello,
I have an array of precomputed integers, it's fixed size of 15M values. I need to load these values at the program start. Currently it takes up to 2 mins to load, file size is ~130MB. Is it any way to speed-up loading. I'm free to change save process as well.
std::array<int, 15000000> keys;
std::string config = "config.dat";
/...
Hi all,
I have the following method and for some reason the first call to Copy to seems to do nothing? Anyone know why?
In input to the method is compressed and base64 can supply that method to if need.
private byte[] GetFileChunk(string base64)
{
using (
MemoryStream compressedData = new MemoryStream(Convert.Fro...
Hi Everyone,
http://en.wikipedia.org/wiki/Special_Folders
I am having a problem with accessing a special folder in a fopen stream in php.
Example
$fp = fopen("%USERPROFILE%/Desktop/text.txt", 'wb');
fwrite($fp, $data);
fclose($fp);
I try this with sysinternals process monitor running to try and see what is actually happening and it...
Possible Duplicates:
How do I convert an InputStream to a String in Java?
In Java how do a read an input stream in to a string?
I have an InputSteam and need to simply get a single simple String with the complete contents.
How is this done in Java?
...