Micah Genji voz podrias poner el codigo de la clase "nodo" o de ser posible todo tu proyecto para ver mejor donde esta el error!!!!
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúPublic Function Zip(ByVal text As String) As String
Dim buffer() As Byte = Encoding.UTF8.GetBytes(text)
Dim ms As New MemoryStream
Dim _zip As GZipStream = New GZipStream(ms, CompressionMode.Compress, True)
_zip.Write(buffer, 0, buffer.Length)
ms.Position = 0
Dim compressed(ms.Length) As Byte
ms.Read(compressed, 0, compressed.Length)
Dim gzBuffer(compressed.Length + 4) As Byte
System.Buffer.BlockCopy(compressed, 0, gzBuffer, 4, compressed.Length)
System.Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, gzBuffer, 0, 4)
Return Convert.ToBase64String(gzBuffer)
End Function
public static string Zip(string text)
{
byte[] buffer = Encoding.UTF8.GetBytes(text);
MemoryStream ms = new MemoryStream();
using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true))
{
zip.Write(buffer, 0, buffer.Length);
}
ms.Position = 0;
byte[] compressed = new byte[ms.Length];
ms.Read(compressed, 0, compressed.Length);
byte[] gzBuffer = new byte[compressed.Length + 4];
System.Buffer.BlockCopy(compressed, 0, gzBuffer, 4, compressed.Length);
System.Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, gzBuffer, 0, 4);
return Convert.ToBase64String(gzBuffer);
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Compression;
namespace GZipStreamC
{
class Program
{
static void Main(string[] args)
{
string myDescomprimido;
string myComprimido;
Console.WriteLine("Ingrese Palabra");
myDescomprimido = Console.ReadLine();
myComprimido= Zip(myDescomprimido);
Console.WriteLine("");
Console.WriteLine("\"{0}\" comprimido = {1}", myDescomprimido, myComprimido);
Console.WriteLine("");
Console.WriteLine("\"{0}\" descomprimido = {1}", myDescomprimido, UnZip(myComprimido));
Console.ReadKey();
}
public static string Zip(string text)
{
byte[] buffer = Encoding.UTF8.GetBytes(text);
MemoryStream ms = new MemoryStream();
using (GZipStream zip = new GZipStream(ms, CompressionMode.Compress, true))
{
zip.Write(buffer, 0, buffer.Length);
}
ms.Position = 0;
byte[] compressed = new byte[ms.Length];
ms.Read(compressed, 0, compressed.Length);
byte[] gzBuffer = new byte[compressed.Length + 4];
System.Buffer.BlockCopy(compressed, 0, gzBuffer, 4, compressed.Length);
System.Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, gzBuffer, 0, 4);
return Convert.ToBase64String(gzBuffer);
}
public static string UnZip(string compressedText)
{
byte[] gzBuffer = Convert.FromBase64String(compressedText);
using (MemoryStream ms = new MemoryStream())
{
int msgLength = BitConverter.ToInt32(gzBuffer, 0);
ms.Write(gzBuffer, 4, gzBuffer.Length - 4);
byte[] buffer = new byte[msgLength];
ms.Position = 0;
using (GZipStream zip = new GZipStream(ms, CompressionMode.Decompress))
{
zip.Read(buffer, 0, buffer.Length);
}
return Encoding.UTF8.GetString(buffer);
}
}
}
}
Dim gzBuffer() As Byte = Convert.FromBase64String(compressedText)
System.Text.Encoding.ASCII.GetBytes(compressedText)
Imports System.Text
Imports System.IO
Imports System.IO.Compression
Module Module1
Sub Main()
Dim myDescomprimido As String
Dim myComprimido As String
Console.WriteLine("Ingrese Palabra")
myDescomprimido = Console.ReadLine()
myComprimido = Zip(myDescomprimido)
Console.WriteLine("")
Console.WriteLine("{0} comprimido = {1}", myDescomprimido, myComprimido)
Console.WriteLine("")
Console.WriteLine("{0} descomprimido = {1}", myDescomprimido, UnZip(myComprimido))
Console.ReadKey()
End Sub
Public Function Zip(ByVal text As String) As String
Dim buffer() As Byte = Encoding.UTF8.GetBytes(text)
Dim ms As New MemoryStream
Dim _zip As GZipStream = New GZipStream(ms, CompressionMode.Compress, True)
_zip.Write(buffer, 0, buffer.Length)
ms.Position = 0
Dim compressed(ms.Length) As Byte
ms.Read(compressed, 0, compressed.Length)
Dim gzBuffer(compressed.Length + 4) As Byte
System.Buffer.BlockCopy(compressed, 0, gzBuffer, 4, compressed.Length)
System.Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, gzBuffer, 0, 4)
Return Convert.ToBase64String(gzBuffer)
End Function
Public Function UnZip(ByVal compressedText As String) As String
Dim gzBuffer() As Byte = Convert.FromBase64String(compressedText)
Dim ms As New MemoryStream()
Dim msgLength As Integer = BitConverter.ToInt32(gzBuffer, 0)
ms.Write(gzBuffer, 4, gzBuffer.Length - 4)
Dim buffer(msgLength) As Byte
ms.Position = 0
Dim _zip As GZipStream = New GZipStream(ms, CompressionMode.Decompress)
_zip.Read(buffer, 0, buffer.Length - 1)
Return Encoding.UTF8.GetString(buffer)
End Function
End Module