PC Review


Reply
Thread Tools Rate Thread

Compressing Byte Arrays

 
 
G.M. Harland
Guest
Posts: n/a
 
      17th Dec 2003
Please keep in mind that I am a PowerBuilder developer working on his first
..NET project.

I have a VB.NET console app that is responsible for taking MS Word docs and
getting them into an Oracle 9i database using a BLOB column.

I have read in the file using a file stream and then put it in a byte array.
The problem is that I need to compress the byte array before inserting into
the database. I have tried to use ZLIB, but I cannot get the uncompression
to return anything but -5, so I have no way of knowing if the compression
was even valid to begin with.

Any advice/help/samples/etc would be greatly appreciated.

Thanks,
Glenn Harland


 
Reply With Quote
 
 
 
 
Rob Teixeira [MVP]
Guest
Posts: n/a
 
      17th Dec 2003
If you want to take the "easy" way out, J# can deal with Java classes and
Jar files, so it has a compression utility class. Just add a reference to
that assembly and you're good to go. Luckily J# is only Java syntax, but the
assemblies are compiled into CIL (and thus usable by any .NET language). I
think the only ****y detail you have to deal with is that streams in there
work on SBYTE instead of BYTE - this is one of my "damn Java" moments :-)

-Rob Teixeira [MVP]

"G.M. Harland" <(E-Mail Removed)> wrote in message
news:YbODb.25581$(E-Mail Removed)...
> Please keep in mind that I am a PowerBuilder developer working on his

first
> .NET project.
>
> I have a VB.NET console app that is responsible for taking MS Word docs

and
> getting them into an Oracle 9i database using a BLOB column.
>
> I have read in the file using a file stream and then put it in a byte

array.
> The problem is that I need to compress the byte array before inserting

into
> the database. I have tried to use ZLIB, but I cannot get the

uncompression
> to return anything but -5, so I have no way of knowing if the compression
> was even valid to begin with.
>
> Any advice/help/samples/etc would be greatly appreciated.
>
> Thanks,
> Glenn Harland
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scanning byte arrays Vince Panuccio Microsoft C# .NET 7 8th May 2007 01:24 PM
Concatenating two arrays of byte together Richard L Rosenheim Microsoft VB .NET 4 14th Dec 2004 02:57 AM
Concatenate Byte[] arrays Marius Cabas Microsoft C# .NET 4 12th Nov 2004 11:20 AM
how to add 2 byte arrays in VB.NET? Khanh Microsoft Dot NET Compact Framework 1 17th May 2004 01:11 PM
IntPtr and Byte arrays anonymous Microsoft Dot NET Compact Framework 4 30th Oct 2003 11:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:33 PM.