Click here to Skip to main content
16,012,316 members
Home / Discussions / C#
   

C#

 
GeneralRe: MSXML package Pin
Spacix One12-Jul-08 8:56
Spacix One12-Jul-08 8:56 
GeneralRe: MSXML package Pin
George_George13-Jul-08 0:37
George_George13-Jul-08 0:37 
QuestionMeaning of "??" in C# Pin
Member 391904918-Jun-08 14:52
Member 391904918-Jun-08 14:52 
AnswerRe: Meaning of "??" in C# Pin
AB777118-Jun-08 15:07
AB777118-Jun-08 15:07 
AnswerRe: Meaning of "??" in C# Pin
darkelv18-Jun-08 15:21
darkelv18-Jun-08 15:21 
GeneralRe: Meaning of "??" in C# Pin
Anthony Mushrow18-Jun-08 23:44
professionalAnthony Mushrow18-Jun-08 23:44 
GeneralRe: Meaning of "??" in C# Pin
Member 391904919-Jun-08 6:15
Member 391904919-Jun-08 6:15 
QuestionXml Streaming Pin
Dirso18-Jun-08 14:24
Dirso18-Jun-08 14:24 
Hi,

I have this methods and they work fine for FileStreams, but once I try to use the Xml.Save(stream) option and encode this stream, it reads nothing from it. Here is my code:

private void geraGzipToolStripMenuItem1_Click(object sender, EventArgs e)
{
    XmlDocument doc = new XmlDocument();
    doc.LoadXml("<teste><dirso>ama posa</dirso></teste>");
    FileStream f = new FileStream("C:\\DADOS\\JR\\JRFW\\bin\\output\\read.xml.gz",
        FileMode.OpenOrCreate, FileAccess.Write);
    GZipEx gz = new GZipEx();
    gz.EncodeXml(doc, f);
}

public void EncodeXml(XmlDocument xml, Stream streamOut)
{
    Stream m = new MemoryStream();
    xml.Save(m);
    EncodeStream(m, streamOut);
    xml.Save("C:\\DADOS\\JR\\JRFW\\bin\\output\\teste.xml");
}

public void EncodeStream(Stream streamIn, Stream streamOut)
{
    GZipOutputStream gz = new GZipOutputStream(streamOut);
    byte[] btout = new byte[bufferSize];
    int nRead;
    while ((nRead = streamIn.Read(btout, 0, bufferSize)) > 0)
    {
        gz.Write(btout, 0, nRead);
    }
    gz.Flush();
    gz.Close();
    streamOut.Close();
}

Please, don't worry about GZipOutputStream. It's working fine. Just the streamIn is not reading anything to btout. I also checked the streamIn length and it DO have data.

Thanks,
Dirso.
AnswerRe: Xml Streaming Pin
leppie18-Jun-08 21:59
leppie18-Jun-08 21:59 
GeneralRe: Xml Streaming Pin
Dirso19-Jun-08 2:40
Dirso19-Jun-08 2:40 
QuestionHow can we create Image type from base64 string ? Pin
Mohammad Dayyan18-Jun-08 10:47
Mohammad Dayyan18-Jun-08 10:47 
AnswerRe: How can we create Image type from base64 string ? Pin
Bert delaVega18-Jun-08 11:00
Bert delaVega18-Jun-08 11:00 
AnswerRe: How can we create Image type from base64 string ? Pin
Colin Angus Mackay18-Jun-08 11:02
Colin Angus Mackay18-Jun-08 11:02 
GeneralRe: How can we create Image type from base64 string ? Pin
Mohammad Dayyan18-Jun-08 11:32
Mohammad Dayyan18-Jun-08 11:32 
GeneralRe: How can we create Image type from base64 string ? Pin
User 665818-Jun-08 11:41
User 665818-Jun-08 11:41 
GeneralRe: How can we create Image type from base64 string ? Pin
Mohammad Dayyan18-Jun-08 11:46
Mohammad Dayyan18-Jun-08 11:46 
GeneralRe: How can we create Image type from base64 string ? Pin
User 665818-Jun-08 11:48
User 665818-Jun-08 11:48 
GeneralRe: How can we create Image type from base64 string ? Pin
Mohammad Dayyan18-Jun-08 11:56
Mohammad Dayyan18-Jun-08 11:56 
QuestionOpenSSL key generation in PEM format Pin
Mike Bentzen18-Jun-08 10:44
Mike Bentzen18-Jun-08 10:44 
QuestionSerial Port Help Pin
Chase Davis18-Jun-08 9:30
Chase Davis18-Jun-08 9:30 
AnswerRe: Serial Port Help Pin
carbon_golem18-Jun-08 10:01
carbon_golem18-Jun-08 10:01 
AnswerRe: Serial Port Help Pin
Alan N18-Jun-08 10:09
Alan N18-Jun-08 10:09 
GeneralRe: Serial Port Help Pin
Chase Davis18-Jun-08 10:20
Chase Davis18-Jun-08 10:20 
GeneralRe: Serial Port Help Pin
Alan N18-Jun-08 13:10
Alan N18-Jun-08 13:10 
QuestionHow to check if keyboard input occurs within a certain time limit? Pin
Michael Zmuda18-Jun-08 9:13
Michael Zmuda18-Jun-08 9:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.