Zip data posted from client does not show up correctely at Server

The java client post GZip'd data to the Webserver. The webserver for some reason shows the first 10 bytes correctly. Not sure what I am overlooking
Also get java.io.EOFException: Unexpected end of ZLIB input stream
public class GetPost {
     public String line;
     public String inputLine;
public static void main(String[] args) throws Exception {
          GetPost r = new GetPost();
               r.postURL("User","pass");
// public Reverse { }
public static byte [] zip(String data)
throws IOException
byte[] incomingBytes = data.getBytes();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream zip = new GZIPOutputStream(baos);
for (int i = 0; i < incomingBytes.length; i++)
zip.write(incomingBytes[i] & 0xFF);
zip.close();
byte[] uncompressedBytes = baos.toByteArray();
return uncompressedBytes;
public static String unzip(byte [] dataBytes)
throws IOException
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ByteArrayInputStream bios = new ByteArrayInputStream(dataBytes);
GZIPInputStream unzip = new GZIPInputStream(bios);
int in = unzip.read();
while (in != -1)
baos.write(in);
in = unzip.read();
unzip.close();
return new String(baos.toByteArray());
public String postURL( String t1 , String t2 ){
try {
          String data1="h";
URL urlpost = new URL("http://192.168.15.4:8080/result.html");
     URLConnection conn = urlpost.openConnection();
     conn.setDoOutput(true);
     GZIPOutputStream gz = new GZIPOutputStream(conn.getOutputStream());
     byte [] kkkk=zip(data1);
     String uuu=unzip(kkkk);
     System.out.println("XXXXX" + uuu );
     for (int i=0; i< kkkk.length ; i++){
          Byte jj= new Byte(kkkk);
          System.out.println("LLLL " + " " + i + " " + jj );
     int t= kkkk.length;
     System.out.println("IIII" + t);
     int x= data1.getBytes().length;
     gz.write(kkkk);
     gz.finish();
     gz.close();
     // Get the response
     BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
     while ((line = rd.readLine()) != null) {
     // Process line...
     System.out.println ("The line is " + line );
     } catch (Exception e) {
          return line;
The client output is
LLLL 0 31
LLLL 1 -117
LLLL 2 8
LLLL 3 0
LLLL 4 0
LLLL 5 0
LLLL 6 0
LLLL 7 0
LLLL 8 0
LLLL 9 0
LLLL 10 -53
LLLL 11 0
LLLL 12 0
LLLL 13 -25
LLLL 14 6
LLLL 15 107
LLLL 16 -111
LLLL 17 1
LLLL 18 0
LLLL 19 0
LLLL 20 0
Server output is correct only for the first 10 bytes
LLLL 0 31
LLLL 1 -117
LLLL 2 8
LLLL 3 0
LLLL 4 0
LLLL 5 0
LLLL 6 0
LLLL 7 0
LLLL 8 0
LLLL 9 0
LLLL 10 -53
LLLL 11 0
LLLL 12 0
LLLL 13 -25
LLLL 14 6
LLLL 15 107
LLLL 16 -111
LLLL 17 1
LLLL 18 0
LLLL 19 0
LLLL 20 0

FYI - I got it to work ... I was gzip it twice... here is what worked
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.zip.*;
import java.io.OutputStreamWriter;
public class WorkingCopyOfGetPost {
     public String line;
     public String inputLine;
public static void main(String[] args) throws Exception {
          WorkingCopyOfGetPost r = new WorkingCopyOfGetPost();
               r.postURL("User","pass");
// public Reverse { }
public static byte [] zip(String data) throws IOException {
     byte[] incomingBytes = data.getBytes();
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     GZIPOutputStream zip = new GZIPOutputStream(baos);
     for (int i = 0; i < incomingBytes.length; i++){
          zip.write(incomingBytes[i] & 0xFF);
     zip.close();
     byte[] uncompressedBytes = baos.toByteArray();
     return uncompressedBytes;
public static String unzip(byte [] dataBytes) throws IOException {
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     ByteArrayInputStream bios = new ByteArrayInputStream(dataBytes);
     GZIPInputStream unzip = new GZIPInputStream(bios);
     int in = unzip.read();
     while (in != -1){
          baos.write(in);
          in = unzip.read();
     unzip.close();
     return new String(baos.toByteArray());
public static ByteArrayOutputStream zip1(String data) throws IOException {
          byte[] incomingBytes = data.getBytes();
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          GZIPOutputStream zip = new GZIPOutputStream(baos);
          for (int i = 0; i < incomingBytes.length; i++){
               zip.write(incomingBytes[i] & 0xFF);
          zip.close();
          //byte[] uncompressedBytes = baos.toByteArray();
          return baos;
public String postURL( String t1 , String t2 ){
     String data1="t";
     try {
          /* byte [] kkkk=zip(data1);
          for (int x=0;x<20;x++){
               System.out.println("Byte Array Values " + x + kkkk[x] );
          ByteArrayOutputStream bo= zip1(data1);
          byte [] AAA=bo.toByteArray();
          for (int x=0;x<21;x++){
               System.out.println("Byte Array Values " + x + " "+ AAA[x] );
          URL urlpost = new URL("http://192.168.15.4:8080/result.html");
     URLConnection conn = urlpost.openConnection();
     conn.setDoOutput(true);
     System.out.println( "The size of the byteArrayOutputstream " + bo.size() );
     bo.writeTo(conn.getOutputStream());
     // GZIPOutputStream gz = new GZIPOutputStream(conn.getOutputStream());
     // System.out.println("rrrr " + kkkk.length);
     // gz.write(kkkk);
     //gz.finish();
     //gz.flush();
     bo.flush();
     // String s=unzip(kkkk) ;
     //System.out.println("s " + s);
     // Get the response
     BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
     while ((line = rd.readLine()) != null) {
     // Process line...
     System.out.println ("The line is " + line );
     rd.close();
     bo.close();
     } catch (Exception e) {
          return line;
}

Similar Messages

  • HT1937 i have a white iphone 4 that says it was approved but restoring from itunes does not show (congrats unlocked message)

    i have a white iphone 4 that says it was approved but restoring from itunes does not show (congrats unlocked message)
    hel

    MaDCrackeR wrote:
    Email from AT&amp;T says the IMEI number was approved for unlocking
    ..........4S that worked fine and it shows the message "congrats unlocked" in itunes
    When restored. But the 4 does not. AT&amp;T insists its unlocked but they are only going off
    Of the request and IMEI number. Is there a way from the phone i can verify it was unlocked?
    If AT&T e-mail says it is unlocked, then believe it is so. Insert non-AT&T SIM inside and after backing up restore in iTunes again. Unlock gets attached.
    You can check the status of the unlock request on AT&T web-site.

  • Mini Calendar does not show the correct date

    Hi there ,
    in iCal on the bottom left side of the window is the mini Calendar, when I switch between months in this mini Cal,it does not show the correct month anymore and even the button "Today" can not revert the day back ( for example we are now in September, when I open iCal it shows it correctly but after going to next or previous months using the triangles on this mini Cal, the problem comes up ! )

    Maybe it wasn't receiving the correct info from your carrier. You're supposed to turn your phone off once in a while so the carrier can update stuff. I had originally heard that you should do it once a day but I never did that.

  • Oam does not show the correct configuration information

    Oracle apps,
    An issue with the oam.
    There are 2 nodes in our system. In 12
    One is for db and cm
    The other is for forms and apache.
    The system is running fine.
    But from the OAM, where it does not show the correct configuration info.
    From the OAM, all the services are (including db, cm, forms, apache) on one node.
    The issue might be caused by the fact that the web tier was cloned from the cm tier as a workaround for some patch errors in web tier.
    I even used the EXEC FND_CONC_CLONE.SETUP_CLEAN; to clean the system tables and ran
    Autocfg on all tiers. But it didn’t solve this issue.
    How can I fix this OAM problem to make it show the correct information?
    Thanks,
    Lily

    Thanks for reply.
    Yes, I did commit it.
    The hostname information is correct.
    On oam, this web node is there but all the service actually running on this node is
    showing under the cm node .
    <TIER_DB oa_var="s_isDB">NO</TIER_DB>
    <TIER_ADMIN oa_var="s_isAdmin">YES</TIER_ADMIN>
    <TIER_WEB oa_var="s_isWeb">YES</TIER_WEB>
    <TIER_FORMS oa_var="s_isForms">YES</TIER_FORMS>
    <TIER_NODE oa_var="s_isConc">YES</TIER_NODE>
    <TIER_FORMSDEV oa_var="s_isFormsDev">YES</TIER_FORMSDEV>
    <TIER_NODEDEV oa_var="s_isConcDev">YES</TIER_NODEDEV>
    <TIER_WEBDEV oa_var="s_isWebDev">YES</TIER_WEBDEV>

  • Cannot create new Data Source - Oracle ODBC does not show in System DSN

    On Windows 7 x64, Installed Oracle 10g to use ODBC to connect to Oracle database but am not able to create new data source as Oracle ODBC does not show in System DSN.... only shows SQL server etc etc...

    If you installed 32-bit Database Client, try the 32-bit ODBC admin tool: C:\Windows\SysWOW64\odbcad32.exe
    Note that 10.2.0.5 is the earliest "10g" version supported on Win 7.
    http://download.oracle.com/docs/cd/B19306_01/relnotes.102/b15680/toc.htm#BABEBBJF
    As an alternative, try the 11.2 Instant Client.
    For 32-bit apps: http://www.oracle.com/technetwork/topics/winsoft-085727.html
    64-bit/x64: http://www.oracle.com/technetwork/topics/winx64soft-089540.html

  • Drop Down In List From Lookup Does Not show all items in mobile view

    I have list called "incident".
    I have a list called "locations"
    The "incident" list looks up a value from the "location" list as a dropdown.
    The location list contains 25 building names.
    When I try to fill out the "incident" list in mobile view
    the "location" drop down only shows 16 items. I checked the "locations" mobile view limit and set it to 99 to make sure all would show up.
    The desktop view for the "incident" list shows all 25 buildings from the "locations" list.
    Any advice on how to get those extra 7 locations to show up?
    Jef

    Still don't have an answer. I'm now looking to use a radio button or something to use as a work-around. If I use a lookup and tell it to allow multiple selections (shows as checkbox) it does not show all values in the mobile view.
    If I input each item and choose choice, it only shows up as dropdown. I need radio buttons. If I choose lookup and allow multiple selections, it does not show all the options.
    I need some help on this.
    Jef

  • Data manager package log does not show Global variables!!

    Hello Experts,
    We are using BPC 10 sp14 Microsoft version with SQL Server 2008 R2. We are seeing an issue where datamanager package log does not show the Global variables defined in package script whereas in BPC 7.5 Global variable were visible in package log.
    Please let us know is this behavior changed in BPC 10?
    Below is the package script having Global variables and Package log not showing any of them.
    Thanks & Regards,
    Rohit
    Package Script:
    Package Log:

    Hi Ergin,
    As far as I remember it's by design...
    Vadim

  • CRVS2010 beta - Date field from database does not display in report

    Hi there - can someone please help?!
    I am getting a problem where a date field from the database does not display in the report viewer (It displays on my dev machine, but not on the client machines...details given below)
    I upgraded to VS 2010
    I am using the CRVS2010 Beta
    My development machine is Windows 7 - and so is my fellow developer's
    We are using Microsoft SQL Server 2000
    We run the queries within VS and then we send the data table to VS using .SetDataSource
    We have a few reports which display the date on our dev machines (whether we run the EXE or from within Visual Studio)
    When we roll out to the client machines (running Windows XP SP3) then everything works, except that the date does not display (on quite a few reports)
    This is the only real issue I have had - a show stopper for me
    The rest works well - any input will be greatly appreciated
    Regards,
    Ridwan

    Hi Ridwan,
    After much testing I have it all working now using CRDB_adoplus.dll as a data source ( XML )
    Alter your Config file to look like this:
    <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
    </startup>
    Then using the code below, and CR requires the Schema to be able to read the date format.
    private void SetToXML_Click(object sender, EventArgs e)
    CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    ISCDReportClientDocument rcd;
    rcd = rptClientDoc;
    string connString = "Provider=SQLOLEDB;Data Source=dwcb12003;Database=xtreme;User ID=sb;Password=password";
    string sqlString = "Select * From Orders";
    OleDbConnection oleConn = new OleDbConnection(connString);
    OleDbDataAdapter oleAdapter = new OleDbDataAdapter(sqlString, oleConn);
    //OleDbDataAdapter oleAdapter2 = new OleDbDataAdapter(sqlString2, oleConn);
    DataTable dt1 = new DataTable("Orders");
    oleAdapter.Fill(dt1);
    System.Data.DataSet ds = new System.Data.DataSet();
    // We need the schema to get the data formats
    ds.WriteXml("c:
    sc.xml", XmlWriteMode.WriteSchema);
    //Create a new Database Table to replace the reports current table.
    CrystalDecisions.ReportAppServer.DataDefModel.Table boTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();
    //boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
    PropertyBag boMainPropertyBag = new PropertyBag();
    //boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
    //In the main property bag (boMainPropertyBag)
    PropertyBag boInnerPropertyBag = new PropertyBag();
    //Set the attributes for the boInnerPropertyBag
    boInnerPropertyBag.Add("File Path ", @"C:\sc.xml");
    boInnerPropertyBag.Add("Internal Connection ID", "{680eee31-a16e-4f48-8efa-8765193dccdd}");
    //Set the attributes for the boMainPropertyBag
    boMainPropertyBag.Add("Database DLL", "crdb_adoplus.dll");
    boMainPropertyBag.Add("QE_DatabaseName", "");
    boMainPropertyBag.Add("QE_DatabaseType", "");
    //Add the QE_LogonProperties we set in the boInnerPropertyBag Object
    boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
    boMainPropertyBag.Add("QE_ServerDescription", "NewDataSet");
    boMainPropertyBag.Add("QE_SQLDB", "False");
    boMainPropertyBag.Add("SSO Enabled", "False");
    //Create a new ConnectionInfo object
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo =
    new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
    //Pass the database properties to a connection info object
    boConnectionInfo.Attributes = boMainPropertyBag;
    //Set the connection kind
    boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
    //*EDIT* Set the User Name and Password if required.
    boConnectionInfo.UserName = "";
    boConnectionInfo.Password = "";
    //Pass the connection information to the table
    boTable.ConnectionInfo = boConnectionInfo;
    //Get the Database Tables Collection for your report
    CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables;
    boTables = rptClientDoc.DatabaseController.Database.Tables;
    //For each table in the report:
    // - Set the Table Name properties.
    // - Set the table location in the report to use the new modified table
    boTable.Name = "Orders";
    boTable.QualifiedName = "Orders";
    boTable.Alias = "Orders";
    rptClientDoc.DatabaseController.SetTableLocation(boTables[0], boTable);
    //Verify the database after adding substituting the new table.
    //To ensure that the table updates properly when adding Command tables or Stored Procedures.
    rptClientDoc.VerifyDatabase();
    MessageBox.Show("Data Source Set", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
    Thanks again
    Don

  • Open file dialog search does not show the correct files

    When i use "open file" in the menu of, for example Pages, and then type a word of my desired file name into the search dialog it does not always find the file. Searching in Finder works. And the file is where it is supposed to be.
    Does it use different kind of searches? I have "reindexed" spotlight but no avail.
    Of course i can look for the file manually and then start pages by double clicking the file...
    Any ideas?
    thanks wolf

    I'm not sure how Pages treats this, but it's possible that from an Open File dialog it may only search either the current directory or the default documents folder. Not sure about this as I'm not a Pages' user.

  • Incomplete Data on report (report does not show all records from the table)

    Hello,
    I have problem with CR XI, I'm running the same report on the same data with simple select all records from the table (no sorting, no grouping, no filters)
    Sometimes report shows me all records sometimes not. Mostly not all records on the report. When report incomplete sometimes it shows different number of records.
    I'm using CR XI runtime on Windows Server 2003
    Any help appreciated
    Thanks!

    Sorry Alexander. I missed the last line where you clearly say it is runtime.
    A few more questions:
    - Which CR SDK are you using? The Report Designer Component or the CR assemblies for .NET?
    - What is the exact version of CR you are using (from help | about)
    - What CR Service Pack are you on?
    And a troubleshooting suggestion:
    Since this works on some machines, it will be a good idea to compare all the runtime (both CR and non CR) being loaded on a working and non working machines.
    Download the modules utility from here:
    https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip
    and follow the steps as described in this thread:
    https://forums.sdn.sap.com/click.jspa?searchID=18424085&messageID=6186767
    The download also includes instructions on how to use modules.
    Ludek

  • Export to PDF from Infoview does not show correct data - CRS 2008

    I have a problem where users attempt to export a report from the Infoview interface to a PDF.  The report shows correctly in Infoview while in Crystal Reports format, but when the use exports the data, the data changes and shows different values.  To troubleshoot, I have tried this on different clients - without a change in the result.  I have also pulled the latest instance of the report from this history on the Central Management Console.  Interestingly enough, the same thing happens when I export to a PDF from there as well.  Any insight or help would be greatly appreciated.  Thanks!

    Hello,
    I can't tell you offhand on what the issue is here, as various factors come into play.
    Here are a few troubleshooting steps you can try:
    - Try opening the report in Crystal Report designer and export to pdf from there. Does this work?
    - Instead of viewing the report and export; schedule a report to PDF and check the results.
    - there is currently a know issue in regards of certain formulas and using font type "arial Unicode MS" that gives incorrect export to pdf. Maybe alter the font used.. or see if you take out any questionable formulas and try again to export.
    Regards,
    Duncan

  • Discoverer Report opened from Portal does not show correct data

    Hi,
    When I try to open a Discoverer report from a portal that I created, it shows stale data but when I click on "Analyze", it shows all the data correctly.
    Does anyone know what the reason could be for this?
    Thank you,
    Santoshi

    I assume you used the Discoverer Portlet Provider. A discoverer portlet is never live data. When you define the portlet you specify how often to 'refresh' the data. If you skipped this step, then you just get the data as-of when you created the portlet.
    Generally you specify the refresh time to be sometime after your usual database load completes.

  • User search from "Find Someone" in Lync 2013 client does not show contact availability

    Running Lync 2013 Client / Server, when a user searches in the "find someone" field, contact names are returned, but the contact's presence status shows "Updating..." and never populates with the users presence.  If you then select
    a name from the search and open an IM session with them, the presence data is there and is accurate.  I think this feature used to work fine.  

    Hi,
    Did the issue happen only for you or for multiple users?
    Please enter the sip address instead of the name of the user in the “find someone” field to test the issue.
    Please also run Update-CsUserDatabase on FE server then remove Lync client profile to test the issue.
    User profile path: <user profile>\AppData\Local\Microsoft\Office\15.0\Lync\
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • My SCCM Client does not show all the tabs in the Config manager control pannel

    Hi All,
    I have a issue Post pushing a installation on a client. It was installed successfully. But i do not get all the options in the control panel as per the below screenshot.
    I reinstalled the client via push from the console during the re installation i got the below errors as per the below screenshot.
    Can any one tell me why is this issue happening.
    I get all the options in my SCCM DP / Site server control panel but not in the client.
    I got the DP role re installed, As well as well as checked the DNS. Iam able to ping from my client machine to the Site server / DP via ip as well as FQDN.
    Can any one please help?
    Gautam.75801

    Got the solution.
    1. Reconfigure the boundary and boundary groups and rebooted the SCCM DP / Site server.
    2. Turn firewall off in the client and uninstall the SCCM setup in the client and Rebooted the client and re install the client via push method from console
    3. Turned off the UAC in the client machine.
    Now i am able to get all the tabs s well as Console shows the server as a client.
    Gautam.75801

  • Build Team from PWA does not shows full list of users

    When building team in PWA, only few users show up in the list. If going first to Resource Plan, then Build Team, the full list shows up. Is it the right way to build team or there is something missing here. The case is with the administrator also. Thanks
    Best Regards
    Dolly Pandey

    Hi Dolly,
    If I understand well, you are seeing the complete enterprise resource pool when you create the team from the resource plan, but not from the project team (in schedule PWA page)?
    Ensure that you don't have any filters applying.
    Also the view applied can contain a filter in this definition (server settings, manage view, then check for the concerned view)
    Finally, depending on the version you have, you might have used the department feature, that might automatically filter on resources based on the department configuration versus resources.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

Maybe you are looking for