Click here to Skip to main content
15,921,989 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Dave Kreskowiak19-Nov-08 2:01
mveDave Kreskowiak19-Nov-08 2:01 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586219-Nov-08 2:13
thiru_586219-Nov-08 2:13 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Dave Kreskowiak19-Nov-08 4:44
mveDave Kreskowiak19-Nov-08 4:44 
JokeRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Paul Conrad19-Nov-08 4:54
professionalPaul Conrad19-Nov-08 4:54 
AnswerRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Paul Conrad18-Nov-08 4:55
professionalPaul Conrad18-Nov-08 4:55 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 19:05
thiru_586218-Nov-08 19:05 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
Paul Conrad18-Nov-08 19:25
professionalPaul Conrad18-Nov-08 19:25 
GeneralRe: Decompressing Text file FROM A COMPRESSED FILE Pin
thiru_586218-Nov-08 20:45
thiru_586218-Nov-08 20:45 
Sorry Paul.. I gave the old code .. Below u can find the latest code i used.
In the below.. am getting the exception in line
"n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)"


'Compressed File path
dim comp_file as string = "c:/compressed.txt"
'File to which decompressed contents has to be written
dim dest_file as string ="c:/decompressed.txt"

Dim sourceFile As FileStream = File.OpenRead(comp_file)
Dim destinationFile As FileStream = File.Create(dest_file)
destinationFile.Close()
Dim ms As New MemoryStream()
Dim zipStream As New DeflateStream(ms, CompressionMode.Decompress)
Dim decompressedBuffer(3500) As Byte


System.IO.File.WriteAllBytes(dest_file, decompressedBuffer)
'end writing

'Because the uncompressed size of the file is unknown,
'we are imports an arbitrary buffer size.
Dim buffer(4096) As Byte
Dim n As Integer

Using input As New GZipStream(sourceFile, _
CompressionMode.Decompress, False)

Console.WriteLine("Decompressing {0} to {1}.", sourceFile.Name,_
destinationFile.Name)

n = input.Read(decompressedBuffer, 0, decompressedBuffer.Length)
destinationFile.Write(decompressedBuffer, 0, n)
End Using

'Close the files.

sourceFile.Close()
destinationFile.Close()
QuestionHow to register COM component into c# .net window application Pin
veereshIndia17-Nov-08 22:33
veereshIndia17-Nov-08 22:33 
AnswerRe: How to register COM component into c# .net window application Pin
indian14318-Nov-08 0:45
indian14318-Nov-08 0:45 
AnswerRe: How to register COM component into c# .net window application Pin
Dave Kreskowiak18-Nov-08 1:57
mveDave Kreskowiak18-Nov-08 1:57 
AnswerRe: How to register COM component into c# .net window application Pin
Paul Conrad18-Nov-08 4:57
professionalPaul Conrad18-Nov-08 4:57 
GeneralRe: How to register COM component into c# .net window application Pin
leckey18-Nov-08 6:19
leckey18-Nov-08 6:19 
GeneralRe: How to register COM component into c# .net window application Pin
Jon_Boy18-Nov-08 6:44
Jon_Boy18-Nov-08 6:44 
GeneralRe: How to register COM component into c# .net window application Pin
Paul Conrad18-Nov-08 6:45
professionalPaul Conrad18-Nov-08 6:45 
GeneralRe: How to register COM component into c# .net window application Pin
indian14318-Nov-08 18:16
indian14318-Nov-08 18:16 
RantRe: How to register COM component into c# .net window application Pin
Smithers-Jones19-Nov-08 1:01
Smithers-Jones19-Nov-08 1:01 
GeneralRe: How to register COM component into c# .net window application Pin
indian14319-Nov-08 1:09
indian14319-Nov-08 1:09 
GeneralRe: How to register COM component into c# .net window application Pin
Dave Kreskowiak19-Nov-08 2:04
mveDave Kreskowiak19-Nov-08 2:04 
QuestionGridView Problem Pin
soniasan17-Nov-08 20:27
soniasan17-Nov-08 20:27 
AnswerRe: GridView Problem Pin
Mycroft Holmes17-Nov-08 20:59
professionalMycroft Holmes17-Nov-08 20:59 
AnswerRe: GridView Problem Pin
Dave Kreskowiak18-Nov-08 1:54
mveDave Kreskowiak18-Nov-08 1:54 
Questionmoving folders and files across network [modified] Pin
jishbalan17-Nov-08 19:01
jishbalan17-Nov-08 19:01 
AnswerRe: moving folders and files across network Pin
Dave Kreskowiak18-Nov-08 1:51
mveDave Kreskowiak18-Nov-08 1:51 
Questiondatagridview with BLL middle-tier Pin
Fahim A17-Nov-08 12:09
Fahim A17-Nov-08 12:09 

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.