Byte b = new Byte((byte)in.read()); conversion error

Hi
I receive with a DataInputStream with:
Byte b = new Byte((byte)in.read());
If i send bytes < 0x79 or > 0xa0 all works, otherwise I obtain, i.e:
0x80 = -84 (right)
0x81 = -3
0x82 = 26
Why???

In sender side seems ok, in dump file the bytes are ok; this is sender side (dataSend is a LinkedList):
for (Iterator iter = dataSend.iterator(); iter.hasNext();) {  
Byte b = (Byte)iter.next();
bytePark = b.byteValue();
dataOut.write(bytePark);
// then I dump bytePark on file
receiver side:
BufferedReader in = new BufferedReader(
     new InputStreamReader(client.getInputStream()));
Byte e = new Byte((byte)in.read());
if (e.byteValue() == (byte)0xf3) { // I need analize when receive 0xf3
// here e.byteValue() has wrong behavior

Similar Messages

  • My boss cannot create a new subfolder by pressing "new folder" until he's already saved the file to his desktop. A "read only" error appears the first time. Is there a way to create and save to subfolder directly? It's Mavericks/Macbook Pro

    Hi, when my boss wants to save a new file in a new subfolder, he presses "new folder" but cannot create a new one because a “read only” error box appears. Once he saves the file to his Desktop he clicks on “save as” again and then he can create a new subfolder by pressing “new folder.” Is there a way to create and save to a subfolder directly without having to first save somewhere else?

    Your server file handling has nothing, and really nothing to do with Adobe software. If files don't get locked for (over-)writing and/or lose connection to the program opening them, then your server is misconfigured. It's as plain and simple and that. Anything from "known file types"/ file associations not being set correctly, MIME types being botched, crooked user privileges and file permissions, missing Mac server extensions, delayed file writing on the server, generic network timeout issues and what have you. Either way, you have written a longwinded post with no real value since you haven't bothered to provide any proper technical info, most notably about the alleged server. Either way, the only way you can "fix" it is by straightening out your server and network configuration, not some magic switch in Adobe's software.
    Mylenium

  • Problem rendering certain bytes when reading binary file

    I have a two part problem. I am trying to read files of any type from a client and transfer them over a pipe to a UNIX host running a C API. I have this process working for text data just fine however when I try and submit binary data there appears to be some data loss. Most of the file appears to end up on the host but it just isn't as long as the source, nor will it render correctly.
    In investigating this problem I tried to simply output a temporary copy of the transferred file on the client as I was reading the file just to see if my "thinking/process" was correct. The copy of the file ends up the same length but some bytes seem to have been misread. Upon doing a windiff on the source and copy it appears that several characters that are rendered as blocks in the original show up as '?' in the destination file.
    I believe this is an entirely different problem than why I am losing data on the host side but I want to first figure out why this problem is occuring. The below code is how I am reading and writing the binary file. I realize it has some problems with it, it is more of a POC at this point.
               final int BUF_SIZE = 1000;  // 1K
               char[] cBuffer = new char[BUF_SIZE];
               byte[] bBuffer = new byte[BUF_SIZE];
               int read = BUF_SIZE;
               long length = fLocalFile.length();
               FileInputStream fis = new FileInputStream(fLocalFile);
               DataInputStream dis = new DataInputStream(fis);
               FileOutputStream fos = new FileOutputStream("C:\\temp.file", false);
               DataOutputStream dos = new DataOutputStream(fos);
               for (int start = 0; start < length && reply.getSuccess(); start += read)
                   System.out.println("length: " + length + " start: " + start);
                   read = dis.read(bBuffer, 0, BUF_SIZE);
                   // Send the file data
                   String sTemp = sDestName + ":" + new String(bBuffer,0,read);
                   dos.write(bBuffer,0,read);
                   reply = axBridge.execute (Commands.CMD_FILE_TRANSFER_SEND, sTemp);
                dos.close();
            }It seems as if when reading or writing on the data streams some of the characters aren't getting converted correctly. Can anyone help? I've been testing with a PDF if that sheds any light.

    Yes but you ARE converting to a String first which you then send to the axBridge (sTemp!). Try just sending the bytes. You can easily pre-pend the "<filename>:" by sending those first.
    I know that some conversions occur when converting to a String, what they are exactly and what the exact effects are escapes me. Past experience though has taught me to ALWAYS send bytes, with no conversions, what you read is what you send.
    You may need to modify the send/receive protocol so that you send the command first with the filename then the bytes are sent after...
    As for why the file is not being written correctly to: c:\\temp.file, don't know... try the following code, it tends to be one of the "standard" ways of "streaming" data...
         byte buf[] = new byte[bufSize];
         int bRead = -1;
         while ((bRead = in.read (buf)) != -1)
             out.write (buf,
                     0,
                     bRead);
         }     And try just using a FileOutputStream or wrapping in a BufferedOutputStream.

  • Bytes not read from DataInputStream

    I want to read a binary file and translate the data to ascii. In order to do so, I've decided to let one method take care of the opening and reading the data and this is where the problem is; no data is read from the binary file. When the for-loop is executed, the index is printed on the screen and since the number is increasing, it cannot be the for-loop that is malfunctioning. However, the data that should be read, should also be displayed, but that does not happen. Can someone tell me what is wrong with my code?
    Thanks
    Simon
    public void readFromBinary() throws FileNotFoundException,IOException
         //open stream
         FileInputStream fInputStream = new FileInputStream(inFile);
         int lengthInFile = fInputStream.available();
         inStream = new DataInputStream(fInputStream);
         byte[] values = new byte[lengthInFile];
         //read data
         for(int i=0;i<lengthInFile;i++)
    System.out.println("i = "+i);
         values[i] = inStream.readByte();
         String str = new String(values);
         System.out.println(str);
         System.out.println("readFromBinary: Data read, length is "+values.length);
         //close stream
         fInputStream.close();

    values[ i ] = inStream.readByte();You've only read one (more) of the bytes, the other
    values in the array are still zeros
    String str = new String(values);
    System.out.println(str);This doesn't make sense creating a string out of the
    array which just keeps adding one more byte every time
    thru the loop.
    Why not just read the thing as one operation?
    inStream.read(values);Actually meant:
    fInputStream.read(values);
    You shouldn't be using DataInputStream on a stream that wasn't created by a DataOutputStream. But then I don't know what this file is you're messing with.

  • ASM: determine total bytes written/read & IOPS

    Hello
    My Environment:
    Oracle 11.2.0.3 EE
    SuSE Enterprise Linux 11 SP1, 64 Bit
    ASM Diskgroups on RAW Luns (2 per group) in Hitachi Disk Storage
    DB-Server: HP DL380 G7
    I like to switch ASM disks from disk to ssd's, direct attach to via HP DS2700 enclosure:
    Diskgroup +DATA
    5x400GB Enterprise SSD, RAID 5, 1.6TB raw capacity
    used for Redo, Datafiles
    Diskgroup +ARCH
    4x400GB Enterprise SSD, RAID0+1, 800GBraw capacity
    used for Redo, Archives, Flash Recovery Area
    As I could understand SSD technology so far, SSDs have a livetime, meaning there is a guaranteed amount of data which can be read/written on it. My aim is to engineer a system that does not have the point of failure of two broken ssd's in the same RAID group.
    How can I determine the total bytes written/read to the ASM diskgroups so far?
    My idea was to dermine ASM block size (select block_size from v$asm_diskgroup) and then look at total reads and writes columns via iostat command in asmcmd. I assume these values are since last ASM startup.
    Is there a way to determine IOPS per diskgroup?
    Thanks
    scsi

    Doing the calculation for 1. gives me a strange result:
    sys@+ASM> select block_size from v$asm_diskgroup;
    BLOCK_SIZE
          4096
          4096
    sys@+ASM> select STARTUP_TIME from v$instance;
    STARTUP_T
    23-MAR-13
    ASMCMD> iostat
    Group_Name  Dsk_Name   Reads           Writes
    ARCH        ARCH_0000  56794017285632  39811971420672
    ARCH        ARCH_0001  50857383503360  38789309743616
    DATA        DATA_0000  80190065973760  42021664440320
    DATA        DATA_0001  80085260539392  42192811246080
    Total Reads x Block Size = Total amount of data read
    (56794017285632 + 50857383503360) x 4096 Bytes = 4.409401376317112e+17 Bytes = 401032.72 Pebibytes

  • Tcp - bytes to read

    Hi,
    I have a TCP connection between 2 computers. Is there any way to read the data without specify the number of bytes to read? Because I don't know the number of bytes before.

    Hi,
    I you go to "help" > "find examples" you'll find a couple of example VIs called "TCP - Communicator ..." I think you can get inspiration from these.
    For instance in the TCP - Communicator - active" you can see that a constant "512" is linked to "bytes to read" and apparently if there is less dat at the specified port, only available data will be read, so you can just count the characters you received.
    Hope this will help you
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • How can i create a new user with only read rights ?

    How can i create a new user with only read rights ?

    You are asking about a Database User I hope.
    You can look into the Oracle 8i Documentation and find various privillages listed.
    In particular, you may find:
    Chapter 27 Privileges, Roles, and Security Policies
    an intresting chapter.
    You may want to do this with the various tools included with 8i - including the
    Oracle DBA Studio - expand the Security node and you can create USERS and ROLES.
    Or use SQL*Plus. To create a
    user / password named John / Smith, you would login to SQL*Plus as System/manager (or other) and type in:
    Create user John identified by Smith;
    Grant CONNECT to John;
    Grant SELECT ANY TABLE to John;
    commit;
    There is much more you can do
    depending on your needs.
    Please read the documentation.
    -John
    null

  • When I try to print sth I can´t choose my printer. Adobe Reader only shows a printer I used years ago.I aleady deleted and reinstalled the Reader and deleted all other printers from the computer.How can I add a new printer to Adobe Reader?Thanks for help!

    When I try to print sth I can´t choose my printer. Adobe Reader only shows a printer I used years ago.I aleady deleted and reinstalled the Reader and deleted all other printers from the computer.How can I add a new printer to Adobe Reader?Thanks for help!

    Hi,
    I would suggest you to uninstall Adobe Reader using the cleaner tool and then re-install the latest version.
    Adobe Cleaner Tool:- Download Adobe Reader and Acrobat Cleaner Tool - Adobe Labs.
    Latest version of Adobe Reader:- http://get.adobe.com/reader/
    If you still experience the same issue, please share the following information:-
    - Screenshot of Adobe Reader showing printer options
    - Screenshot of Microsoft Word showing printer options
    - Screenshot of control panel- Control Panel\All Control Panel Items\Devices and Printers
    Regards,
    Nakul 

  • Trying to Transfer iTunes to a New computer, but I get the error message The file "iTunes Library.itl" cannot be read because it was created by a newer version of iTunes --- HELP!

    Trying to Transfer iTunes to a New computer, but I get the error message The file "iTunes Library.itl" cannot be read because it was created by a newer version of iTunes --- HELP

    Did you downgrade iTunes? What version is listed in Help> About iTunes?
    If you don't have iTunes 10.5.2, download it from here -> http://www.apple.com/itunes/download/
    If you have iTunes 10.5.2, try re-creating your iTunes library.

  • I have a Olympus C-3000 and it won't read in the new iphoto.  It reads in my old version on my older computer.  Is there a driver I need or something else?

    I have a Olympus C-3000 and it won't read in the new iphoto.  It reads in my old version on my older computer.  Is there a driver I need or something else?

    Yes, different computers, different OS's, as stated, does not work on any machine except PPC.
    Nothing in console logs.  Does not show up in USB under system profiler.
    Level 1 tech support.  "May be this" or "may be that", but all a waste of time unless someone has the actual camera and can independently verify my results.
    If it were just a matter of it happening on one machine that would be one thing.  The fact that it only does not work on Intel based machines (and thus Snow Leopard and Lion) it is a pretty good indicator that something is missing in the OS.

  • PDF Form Requires a newer version of Adobe Reader

    New at this...Created my form in Live Cycle 8.0/Professional 8. Throughout company we are using Acrobat Reader 7.0 and are not at this time looking to upgrade. When our users open this form, get "This PDF form requires a newer version of Adobe Reader..." and prompts them to upgrade. Is there anyway I can get rid of this message...a way to make my form know that users will be opening in 7.0 and accept without error?
    Also, I'm not able to get the Submit to Email button to work...getting "This operation is not permitted"...how can I fix?
    Funny thing is I had been able to get the e-mail button to work at one time, but now, all of the sudden, it doesn't want to work...even on my machine which has Live Cycle/Professional 8 loaded?????
    Thanks!

    Geo,
    Thanks for the quick response. Tried and received: "This PDF document contains an Adobe XML form. Such files cannot be optimized.
    Help...thanks again

  • I have a new version of adobe reader for android on my tablet now i cannot delete files

    I have a new version of adobe reader for android on my tablet. Now there is no delete tab to get rid of old files

    Sorry, I was asking about the version of your Android operating system.  But if your PDF documents are not stored on an SD card, it does not matter which Android version you have.
    To permanently delete a PDF document from your Android device using Adobe Reader,
    In the Reader home screen, tap Documents in the left pane.
    Long press (press & hold) the PDF document that you want to delete.
    Tap the trash can icon in the top toolbar.
    Please note that there is no Undo for the Delete operation.
    If you have many files that you want to delete, it would be easier to download and install a File Manager app and delete files at once.

  • This PDF form requires a newer version of Adobe reader !?

    Hi there
    I use LiveCycle 8 and I design forms for a target audience using Acrobat Reader 7..
    My problem is whatever I put in a form, I get a really annoying message when opened in Acrobat reader 7
    This PDF form requires a newer version of Adobe reader, Without a newer version, the form may be displayed but not work properly etc....
    This doesn't inspire confidence for the user.
    I get this message even if I open a new form, add a single textfield and save as Acrobat 7 PDF form.
    Is there a way around this ?
    Thanks
    Chris

    I am not too sure, I thought that saving as Acrobat 7 pdf,would do that. Is that not the case ? Are you referring to something else ?
    Thanks
    Chris

  • New Square Stand Card Reader - Does it work in Australia?

    I'm in Australia but wanting to buy the new Square Stand (card reader) and wondering if it will work in Australia? This would be a great way to avoid eftpos machine contracts!

    AppleCare's Express Lane.

Maybe you are looking for

  • F380 All-IN-One Printer

    Since i have switched from Windows XP to Window 7, I am no longer able to check the ink levels in my printer. What can i do to be able to do so again?  I still have the installation disk but I'm not sure if I need to use it again because the printer

  • HT202196 Why can't I open my garageband ios song on my Mac?

    This is what it says in Apple support: Use GarageBand for Mac 6.0.2 or later to open GarageBand for iOS songs. My version of GarageBand on my mac is 6.0.5. When I try to open a song I created on my iphone, it tells me that my Mac version of the softw

  • "Software update" doesn't do anything whatsoever!

    I have run "Software update" on my new Intel Mac Pro (10.4.9) successfully. Today, no matter how many times I select it from the Apple menu of Finder, the "Software update" doesn't do anything: no error, no "checking at Apple", nothing! Has anyone se

  • New podcasts not 'red numbered' on app icon anymore.

    Hi all, Very tedious question but my new podcasts (prior to new update) would be numbered in red on the top of the podcast app icon on the home screen to see how many I have to listen to. Since the update they are not doing this. Any help about how I

  • Question sur Camera Raw

    Je n'arrive plus à ouvrir les fichiers ARW dans PE  "impossible d'ouvrir....car ce type de fichier est incorrect". J'ai téléchargé la version 6.5 de Camera Raw sur le site d'Adobe mais il semble que pour mon Sony Alpha 57 c'est la version 6.7 qu'il f