There is something wrong with GZIPInputStream or GZIPOutputStream. Just please read the following code (or run it and see what happens):
def main(a: Array[String]) {
val name = "test.dat"
new GZIPOutputStream(new FileOutputStream(name)).write(10)
println(new GZIPInputStream(new FileInputStream(name)).read())
}
It creates a file test.dat, writes a single byte 10 formatting by GZIP, and read the byte in the same file with the same format.
And this is what I got running it:
Exception in thread "main" java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.GZIPInputStream.read(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at nbt.Test$.main(Test.scala:13)
at nbt.Test.main(Test.scala)
The reading line seems going the wrong way for some reason.
I googled the error Unexpected end of ZLIB input stream and found some bug reports to Oracle, which were issued around 2007-2010. So I guess the bug still remains in some way, but I’m not sure if my code is right, so let me post this here and listen to your advice. Thank you!
I’m trying to round-trip a JSON string to a byte array with DeflaterOutputStream, but the code below throwing java.io.EOFException: Unexpected end of ZLIB input stream.
It works when you replace the string with «Hello world», or if you remove a few characters from the string below.
Any ideas?
public static void main(String[] args) throws IOException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DeflaterOutputStream deflate = new DeflaterOutputStream(bytes, new Deflater(Deflater.BEST_COMPRESSION, true));
OutputStreamWriter writer = new OutputStreamWriter(deflate);
writer.write("[1,null,null,"a",null,null,null,null,[1,null,null,null,null,null,null,null,null,null,null,null,null,0.0,0.0,null,null]");
writer.flush();
writer.close();
InflaterInputStream inflaterIn = new InflaterInputStream(new ByteArrayInputStream(bytes.toByteArray()), new Inflater(true));
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inflaterIn));
System.out.println(bufferedReader.readLine());
}
Java version (OSX):
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
Problem
The Modeler .str file has become corrupt. No recovery exists for the explicit file. If no further action is done within Modeler, the backup .str- file may be intact.
Symptom
«Unexpected end of ZLIB input stream»
Cause
The error message means that the stream file is invalid. The compression procedure involved in creating a stream file is performed by the Java Virtual Machine that is responsible for handling the User Interface. If Modeler Client is closed before the stream has finished saving, then the resulting stream file will be incomplete. To date this problem has been reported only on a few occasions and the lack of available information into the environment leading up to this problem means the problem has not been replicated. If you see Modeler client using a lot of RAM (that the two numbers in the bottom right-hand-corner of the Modeler workpane are very close to each other), then it is possible that saving a large stream within that session will take a significant amount of time as the JVM is using as much memory as it is currently allowed to. In this situation please allow the stream save process to complete — the presence of the hourglass cursor within Modeler client for an extended time in this situation does not indicate an application hang and therefore does not indicate in itself the need for a forceful termination of the process.
We are investigating if we can make it clearer to the user that the stream save is still in progress.
Note it is possible for external factors to corrupt Modeler streams just as they can corrupt any files. If you have Modeler streams that suddenly appear corrupt, but Modeler hasn’t been used to load or save them since previously successful use, then it is likely that something external has corrupted the files on your filesystem. If this is the case please restore the files from backup as you would in the event of corruption of any other file types.
Resolving The Problem
If you experience this issue the stream cannot be recovered, although the backup stream of the same name (but with suffix ‘.str-‘) should be intact. Please delete the corrupted original and use the previous backup stream.
If you have a specific stream that causes this when you attempt to reload it, and the save within Modeler appears to complete (ie. the UI returns for use from the busy hourglass cursor), then please, if possible, follow these steps:
1. Copy the backup stream in Windows explorer (the stream with the same name but with the «.str-» extension to , eg. «mybackup.str» — retain this stream as a master backup).
2. open the backup stream (with the same name as the original stream but a «.str-» extension)
3. document the exact steps that were taken to modify the backup stream so that it is in the exact state it was in immediately before the final save that created the stream file that you can no longer load without this error.
4. Confirm that it is repeatable (ie. confirm that if you again save the stream that you get the same error when you try to reload it into Modeler)
5. If it is, please provide the backup stream, «my backup.str» along with the documentation of the steps you made in step 3. so we can attempt to replicate the issue.
Related Information
[{«Product»:{«code»:»SS3RA7″,»label»:»IBM SPSS Modeler»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Modeler»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»Not Applicable»,»Edition»:»All Editions;Workstation»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]
Содержание
- Exception: Unexpected end of ZLIB input stream
- 1 Answer 1
- what is java.io.EOFException, Message: Can not read response from server. Expected to read 4 bytes, read 0 bytes
- Unexpected error java io eofexception
- Program:
- How to fix Exception in thread «main» java.io.EOFException? (java socket) [duplicate]
- 2 Answers 2
- Linked
- Related
- Hot Network Questions
- java.io.EOFException – How to solve EOFException
- The Structure of EOFException
- Constructors
- The EOFException in Java
- Download the Eclipse Project
Exception: Unexpected end of ZLIB input stream
There is something wrong with GZIPInputStream or GZIPOutputStream . Just please read the following code (or run it and see what happens):
It creates a file test.dat , writes a single byte 10 formatting by GZIP, and read the byte in the same file with the same format.
And this is what I got running it:
The reading line seems going the wrong way for some reason.
I googled the error Unexpected end of ZLIB input stream and found some bug reports to Oracle, which were issued around 2007-2010. So I guess the bug still remains in some way, but I’m not sure if my code is right, so let me post this here and listen to your advice. Thank you!

1 Answer 1
You have to call close() on the GZIPOutputStream before you attempt to read it. The final bytes of the file will only be written when the stream object is actually closed.
(This is irrespective of any explicit buffering in the output stack. The stream only knows to compress and write the last bytes when you tell it to close. A flush() won’t help . though calling finish() instead of close() should work. Look at the javadocs.)
Here’s the correct code (in Java);
(I’ve not implemented resource management or exception handling / reporting properly as they are not relevant to the purpose of this code. Don’t treat this as an example of «good code».)
Источник
what is java.io.EOFException, Message: Can not read response from server. Expected to read 4 bytes, read 0 bytes
This question has been asked a couple of times in SO and many times in other sites. But I didn’t get any satisfiable answer.
My problem:
I have a java web application which uses simple JDBC to connect to mysql database through Glassfish application server.
I have used connection pooling in glassfish server with the following configurations:
Initial Pool Size: 25
Maximum Pool Size: 100
Pool Resize Quantity: 2
Idle Timeout: 300 seconds
Max Wait Time: 60,000 milliseconds
The application has been deployed for last 3 months and it was running flawlessly too.
But from last 2 days the following error is coming at the time of login.
Partial StackTrace
What caused this error suddenly ? I have lost a lot of time for this.
EDIT : The problem even persists after restarting the server. As per DBA two of the important mysql server configurations are:
wait_timeout : 1800 seconds
connect_timeout : 10 seconds
NOTE : Other applications deployed in the same server connecting to the same database and using different pools are running smoothly.
EDIT-2 : After reading a lot of things and expecting some positive outcome I made these changes to my connection pool.
Max Wait Time : 0 (previously it was 60 seconds)
Connection Validation : Required
Validation Method : table
Table Name : Demo
Validate Atmost Once : 40 seconds
Creation Retry Attempts : 1
Retry Intervals : 5 seconds
Max Connection Usage : 5
And this worked as the application is running for 3 days consistently. But I got a very strange and interesting result of out this. While monitoring the connection pool, I found these figures:
NumConnAcquired : 44919 Count
NumConnReleased : 44919 Count
NumConnCreated : 9748 Count
NumConnDestroyed : 9793 Count
NumConnFailedValidation : 70 Count
NumConnFree : 161 Count
NumConnUsed : -136 Count
How can the NumConnFree become 161 as I have Maximum Pool Size = 100 ?
How can the NumConnUsed become -136, a negative number ?
How can the NumConnDestroyed > NumConnCreated ?
Источник
Unexpected error java io eofexception
This exception is usually thrown when the end of file (EOF) is reached unexpectedly while reading the input file.Note that,this exception will also be thrown if the input file contains no data in it.
I have explained this EOF exception with the following program.The following program tries to read the file «exam.txt» and prints its contents.When the reader has reached the end of the file i have thrown the EOF exception to indicate that the file has reached its end.
Program:
public class Example1
<
public static void main(String[] args)throws IOException
<
BufferedReader br=null;
try
<
File f=new File(«E:/exam.txt»);
FileReader reader = new FileReader(f);
br = new BufferedReader(reader);
String strcontent =null;
while(true)
<
if((strcontent=br.readLine()) != null)
<
System.out.println(strcontent);
>
else
<
throw new EOFException();
>
>
>
catch(FileNotFoundException e)
<
e.printStackTrace();
>
catch(EOFException e1)
<
br.close();
System.out.println(«The file has reached its end»);
>
>
>
Thus in the above code the statement «throw new EOFException()» is used to explicily indicate the end of the file and perform the necessary actions rather than letting jvm to deal with it.
In the above program if you do not include the statement throw new EOFException then it will not get terminated.
Sometimes this exception may occur due to an error in the input file.For eg. if the header of the file indicates that the content length of the file is 1000 characters but if you encounter the EOF character after reading some 200 characters.In this situation EOFException can be used to deal with it.
NOTE:
1.When we use Scanner object to read from a file then java.util.NoSuchElementException is thrown if the end of file (EOF) is reached.
2.If we use BufferedReader object to read from a file then no exception will be thrown upon reaching the end of the file.
3. If we use DataInputStream object to read from a file then this EOFException will be thrown if the reader has reached the end of the file.
I have also explained, how using DataInputStream Object to read a file throws the EOFException in the following program.
Источник
How to fix Exception in thread «main» java.io.EOFException? (java socket) [duplicate]
I want to create a simple multiple file transfer program using java socket.
Exception in thread «main» java.io.EOFException at java.io.DataInputStream.readFully(Unknown Source) at java.io.DataInputStream.readLong(Unknown Source) at socket.client.main(client.java:32)
This is my server code! server is sender.
This is my client code! client is receiver.
I expect this output of the client: File count : 2 File names : README.txt vcruntime140.dll

2 Answers 2
On the server side, you are calling fis.read() twice per loop iteration while reading from an input file stream. You need to call it only once per iteration, and you need to pass the return value of fis.read() to dos.write() so it knows the correct number of bytes to write.
On the client side, while reading a file stream, you are calling fos.write() before you have called dis.read() to populate b with data. And you are looping too many times, as you are not updating your j loop counter with the number of bytes actually read per iteration.
Try something more like this instead:
Just to have an example of how code can get cleaner using the Google Gauva library, here is your code changed to use a couple of utility classes from Guava, ByteStreams and Files
Notice the elimination of the read loops. You really should learn how to code a read loop, but in practice you will likely be better served relying on a supported, analyzed, mature, optimized library. I believe Apache commons-io has similar functionality.

Linked
Hot Network Questions
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.1.14.43159
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Источник
java.io.EOFException – How to solve EOFException
Posted by: Sotirios-Efstathios Maneas in exceptions August 19th, 2014 0 Views
In this tutorial we will discuss about the EOFException in Java. This exception indicates the the end of file (EOF), or the end of stream has been reached unexpectedly. Also, this exception is mainly used by DataInputStreams , in order to signal the end of stream. However, notice that other input operations may return a special value upon the end of a stream, instead of throwing an EOFException .
The EOFException class extends the IOException class, which is the general class of exceptions produced by failed, or interrupted I/O operations. Moreover, it implements the Serializable interface. Also, it is defined as a checked exception and thus, it must be declared in a method, or a constructor’s throws clause.
Finally, the EOFException exists since the 1.0 version of Java.
The Structure of EOFException
Constructors
Creates an instance of the EOFException class, setting null as its message.
Creates an instance of the EOFException class, using the specified string as message. The string argument indicates the name of the class that threw the error.
The EOFException in Java
DataInputStreams provide methods that can read primitive Java data types from an underlying input stream in a machine-independent way. An application writes data, by using the methods provided by the OutputStream class, or the DataOutputStream class.
Specifically, primitive types can be read by an application, using one of the following methods:
- readBoolean() – Reads one input byte and returns true if that byte is nonzero, false if that byte is zero.
- readByte() – Reads and returns one input byte.
- readChar() – Reads two input bytes and returns a char value.
- readDouble() – Reads eight input bytes and returns a double value.
- readFloat() – Reads four input bytes and returns a float value.
- readInt() – Reads four input bytes and returns an int value.
- readLong() – Reads eight input bytes and returns a long value.
- readShort() – Reads two input bytes and returns a short value.
- readUnsignedByte() – Reads one input byte and returns it as a zero-extended int value. The integer value resides in the range [0, 255].
- readUnsignedShort() – Reads two input bytes and returns them as an int value. The integer value resides in the range [0, 65535].
For a list of all available methods, take a closer look on the DataInputStream class.
The following example reads all characters from an input file:
In this example we first, write a string to a file and then, use the readChar() method to read all written characters one-by-one.
A sample execution is shown below:
Once the EOFException is thrown, we only have to break from the reading loop and then, close the stream.
Download the Eclipse Project
This was a tutorial about the EOFException in Java.
Источник
I get a Unexpected end of ZLIB input stream error when I try to read a model, I committed before. I have tried the SingleCheckinAndDownload.java example and the error occurs to. After a commit the 3D-view in bimviews does also not work. There is only the loading project bar but without progress. Is there something wrong with my code or is there a problem with the server?
Error :
[AWT-EventQueue-0] INFO org.bimserver.emf.SharedJsonDeserializer — # Objects: 1772
java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:67)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
at org.bimserver.client.ClientIfcModel.loadGeometry(ClientIfcModel.java:347)
at org.bimserver.client.ClientIfcModel.loadDeep(ClientIfcModel.java:303)
at org.bimserver.client.ClientIfcModel.(ClientIfcModel.java:115)
at org.bimserver.client.BimServerClient.getModel(BimServerClient.java:202)
at at.ac.get.opensourcebimeditor.globalsets.setproject(globalsets.java:316)
at at.ac.get.opensourcebimeditor.globalsets.setproject(globalsets.java:491)
at at.ac.get.opensourcebimeditor.GUI.ProjectGUI.jComboBox1ActionPerformed(ProjectGUI.java:410)
at at.ac.get.opensourcebimeditor.GUI.ProjectGUI.access$000(ProjectGUI.java:30)
at at.ac.get.opensourcebimeditor.GUI.ProjectGUI$1.actionPerformed(ProjectGUI.java:147)
at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1258)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:586)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:622)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:861)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:510)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Code for read model:
public static BimServerClient getclient(String url, String user, String passwd) {
try {
JsonBimServerClientFactory factory = new JsonBimServerClientFactory(url);
try (BimServerClient client = factory.create(new UsernamePasswordAuthenticationInfo(user, passwd))) {
return client;
} catch (org.bimserver.shared.exceptions.UserException ex) {
IO.outerror("Benutzername oder Passwort wurde nicht akzeptiert!", "Fehler bei Verbindung");
return null;
} catch (org.bimserver.shared.reflector.ReflectorException ex) {
IO.outerror("Server konnte nicht gefunden werden!", "Fehler bei Verbindung");
return null;
} catch (Exception ex) {
IO.outerror(ex.getMessage(), "Fehler bei Verbindung");
return null;
}
} catch (BimServerClientException ex) {
Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
public void setproject(org.bimserver.interfaces.objects.SProject project) {
this.project = project;
setisifc();
if (project.getLastRevisionId() < 0) {
return;
}
javax.swing.JDialog d = createwait();
try {
model = client.getModel(project, project.getLastRevisionId(), true, true, true);
if (isifc2()) {
ifc2ProductList = model.getAllWithSubTypes(org.bimserver.models.ifc2x3tc1.IfcProduct.class);
}
if (isifc4()) {
ifc4ProductList = model.getAllWithSubTypes(org.bimserver.models.ifc4.IfcProduct.class);
}
} catch (UserException | ServerException ex) {
Logger.getLogger(globalsets.class.getName()).log(Level.SEVERE, null, ex);
}
d.dispose();
}
Code for commit:
private void jButtoncommitActionPerformed(java.awt.event.ActionEvent evt) {
try {
String comtext = JOptionPane.showInputDialog("Bitte Text für commit eingeben: ");
if (comtext == null) {
return;
}
IO.o("TransactionID: " + globalset.getmodel().getTransactionId());
globalset.getmodel().fixOidCounter();
globalset.getmodel().fixOids();
//globalset.getmodel().fixInverseMismatches();
//globalset.getmodel().checkDoubleOidsPlusReferences();
//globalset.getclient().commit(globalset.getmodel(), comtext);
// globalset.getmodel().checkin(globalset.getproject().getRid(), comtext);
javax.swing.JDialog d = globalset.createwait("Daten werden auf den Bimserver übertragen!");
IO.o(globalset.getmodel().commit(comtext));
d.dispose();
IO.o("commited");
IO.o(globalset.getmodel().getTransactionId());
d = globalset.createwait("Model des Bimservers wird neu geladen!");
//model = client.getModel(project, project.getLastRevisionId(), true, true, true);
globalset.setmodel(globalset.getclient().getModel(globalset.getproject(),
globalset.getproject().getLastRevisionId(), true, true));
d.dispose();
IO.o(globalset.getmodel().getTransactionId());
} catch (ServerException ex) {
Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (UserException ex) {
Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (PublicInterfaceNotFoundException ex) {
Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (BimServerClientException ex) {
Logger.getLogger(ifcGUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
Hi Experts,
I have to write a simple code that unziped the files within folders.
While running the code — folders are created and some files unziped properly. but latter on it gives an error: Unexpected end of ZLIB input stream
Below is my code. Please tell me whats wrong with this?
Please reply as soon as possible, its urgent.
<%@ page language="java" import="java.io.File,java.io.FileWriter,java.util.*,java.io.*,java.util.zip.*"%>
<%
String xlsname="",fname="";
String path="D:/mike/source";
try
{
int BUFFER = 2048;
BufferedOutputStream dest = null;
FileInputStream fis = new FileInputStream("D:/mike/source/new200.zip");
ZipInputStream zip = new ZipInputStream(new BufferedInputStream(fis));
ZipEntry entry = zip.getNextEntry();
while((entry = zip.getNextEntry()) != null)
{
System.out.println("Extracting: " +entry);
if ((entry.isDirectory()))
{
fname=entry.getName();
(new File(path+"/"+entry.getName())).mkdir();
continue;
}
else
{
int countm;
byte datam[] = new byte[BUFFER];
// write the files to the disk
FileOutputStream fosm = new FileOutputStream(path+"/"+entry.getName());
dest = new BufferedOutputStream(fosm, BUFFER);
while ((countm = zip.read(datam, 0, BUFFER)) > -1)
{
dest.write(datam, 0, countm);
}
dest.flush();
dest.close();
}
}
// zip.closeEntry();
zip.close();
} catch(Exception zip) {
System.out.println("Error "+zip);
}
%>
Я пытаюсь передать строку JSON в массив байтов с помощью DeflaterOutputStream, но код ниже бросает java.io.EOFException: Unexpected end of ZLIB input stream.
Это работает, когда вы заменяете строку на «Hello world» или если вы удаляете несколько символов из строки ниже.
Есть идеи?
public static void main(String[] args) throws IOException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DeflaterOutputStream deflate = new DeflaterOutputStream(bytes, new Deflater(Deflater.BEST_COMPRESSION, true));
OutputStreamWriter writer = new OutputStreamWriter(deflate);
writer.write("[1,null,null,"a",null,null,null,null,[1,null,null,null,null,null,null,null,null,null,null,null,null,0.0,0.0,null,null]");
writer.flush();
writer.close();
InflaterInputStream inflaterIn = new InflaterInputStream(new ByteArrayInputStream(bytes.toByteArray()), new Inflater(true));
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inflaterIn));
System.out.println(bufferedReader.readLine());
}
Версия Java (OSX):
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)