Converting byte from dec to hex

Hi All,
I'm having a problem converting byte from decimal to hex - i need the following result:
if entered 127 (dec), the output should be 7f (hex).
The following method fails, of course because of NumberFormatException.
    private byte toHexByte(byte signedByte)
        int unsignedByte = signedByte;
        unsignedByte &= 0xff;
        String hexString = Integer.toHexString(unsignedByte);
        BigInteger bigInteger = new BigInteger(hexString);
        //byte hexByte = Byte.parseByte(hexString);
        return bigInteger.byteValue();
    }

get numberformatexception because a lot of hex digits cannot be transformed into int just like that (ie f is not a digit in decimal) heres some code that i used for a pdp11 assembler IDE... but this is for 16-bit 2s complement in binary/octal/decimal/hex , might be useful for reference as example though
    public static String getBase(short i, int base){
        String res = (i>=0)? Integer.toString((int)i,base)
                : Integer.toString((int)65536+i,base) + " ("+Integer.toString((int)i,base)+")";
       StringBuffer pad= new StringBuffer();
        for(int x = 0; x < 16 - res.length() ; x++){
            pad.append("0");
        res = pad.toString() + res;
        return res;
    }

Similar Messages

  • Converting byte[] to Class without using defineClass() in ClassLoader

    so as to de-serialize objects that do not have their class definitions loaded yet, i am over-riding resolveClass() in ObjectInputStream .
    within resolveClass() i invoke findClass() on a network-based ClassLoader i created .
    within findClass() , i invoke
    Class remoteClass = defineClass(className, classImage, 0, classImage.length);
    and that is where i transform a byte[] into a Class , and then finally return a value for the resolveClass() method.
    this seems like a lengthy process. i mean, within resolveClass() i can grab the correct byte[] over the network.
    then, if i could only convert this byte[] to a Class within resolveClass() , i would never need to extended ClassLoader and over-ride findClass() .
    i assume that the only way to convert a byte[] to a Class is using defineClass() which is hidden deep within ClassLoader ? there is something going on under the hood i am sure. otherwise, why not a method to directly convert byte[] to a Class ? the byte[] representation of a Class always starts with hex CAFEBABE, and then i'm sure there is a standard way to structure the byte[] .
    my core issue is:
    i am sending objects over an ObjectInputStream created from a Socket .
    at the minimum, i can see that resolveClass() within ObjectInputStream must be invoked at least once .
    but then after that, since the relevant classes for de-serialization have been gotten over the network, i don't want to cascade all the way down to where i must invoke:
    Class remoteClass = defineClass(className, classImage, 0, classImage.length);
    again. so, right now, within resolveClass() i am using a Map<String, Class> to create the following class cache:
    cache.put(objectStreamClass.getName(), Class);
    once loaded, a class should stay loaded (even if its loaded in the run-time), i think? but this is not working. each de-serialization cascades down to defineClass() .
    so, i want to short-circuit the need to get the class within the resolveClass() method (ie. invoke defineClass() only once),
    but using a Map<String, Class> cache looks really stupid and certainly a hack.
    that is the best i can do to explain my issue. if you read this far, thanks.

    ok. stupid question:
    for me to use URLClassLoader , i am going to need to write a bare-bones HTTP server to handle the class requests, right?Wrong. You have to deploy one, but what's wrong with Apache for example? It's free, for a start.
    and, i should easily be able to do this using the com.sun.net.httpserver library, right?Why would you bother when free working HTTP servers are already available?

  • Checking and Converting binary, octal, decimal, and hex

    Hi,
    I have a classroom project which will need to validate that data entered in a text is of a certain type with a keyListener, and then convert that value to the other 3 types.
    I know character.isDigit will handle the decimal case, and that I can then use Integer.otString methods to convert to binary, octal, and hex, but what about the other cases?
    Thanks

    OK, this isn't working. If I've already established
    that the string entered into, for example, the
    integer-only textfield is a valid integer, I should be
    able to simply use integer.parseint(s, 2) to convert
    it into binary, right?Not exactly. You should be able to use Integer.parseInt(s, 2) to return the result of converting it from binary representation. You appear to think that this affects whatever "s" refers to, which is not the case. Note also, that method returns an int which is the decimal value in question.
    When you are thinking of int variables, be careful not to think of them as "decimal" or "binary". They are neither. They are just numbers. "Decimal" and "binary" are text representations of numbers, so those concepts can only be applied to strings.
    Integer.parseInt(s, 2);
    txtBin.setText(s);So here you want to assume that the input is a string that represents a number in decimal, and you want to find the string that represents the number in binary. Like this:// convert string in decimal representation to number
    int dec = Integer.parseInt(s);
    // convert int to binary representation as string:
    String binary = Integer.toBinaryString(dec);
    // write that to the text field
    txtBin.setText(binary);You could use a one-liner to do that, but you'll need the "dec" variable to set the other text boxes.
    Rembering why I hate OO...All of what I said there is true in just about all computer languages, OO or otherwise.
    PC&#178;

  • Convert byte array to table of int

    [http://www.codeproject.com/KB/database/PassingArraysIntoSPs.aspx?display=Print|http://www.codeproject.com/KB/database/PassingArraysIntoSPs.aspx?display=Print] Hello friends.
    I'm pretty new with PL/SQL.
    I have code that run well on MSSQL and I want to convert it to PL/SQL with no luck.
    The code converts byte array to table of int.
    The byte array is actually array of int that was converted to bytes in C# for sending it as parameter.
    The TSQL code is:
    CREATE FUNCTION dbo.GetTableVarchar(@Data image)
    RETURNS @DataTable TABLE (RowID int primary key IDENTITY ,
    Value Varchar(8000))
    AS
    BEGIN
    --First Test the data is of type Varchar.
    IF(dbo.ValidateExpectedType(103, @Data)<>1) RETURN
    --Loop thru the list inserting each
    -- item into the variable table.
    DECLARE @Ptr int, @Length int,
    @VarcharLength smallint, @Value Varchar(8000)
    SELECT @Length = DataLength(@Data), @Ptr = 2
    WHILE(@Ptr<@Length)
    BEGIN
    --The first 2 bytes of each item is the length of the
    --varchar, a negative number designates a null value.
    SET @VarcharLength = SUBSTRING(@Data, @ptr, 2)
    SET @Ptr = @Ptr + 2
    IF(@VarcharLength<0)
    SET @Value = NULL
    ELSE
    BEGIN
    SET @Value = SUBSTRING(@Data, @ptr, @VarcharLength)
    SET @Ptr = @Ptr + @VarcharLength
    END
    INSERT INTO @DataTable (Value) VALUES(@Value)
    END
    RETURN
    END
    It's taken from http://www.codeproject.com/KB/database/PassingArraysIntoSPs.aspx?display=Print.
    The C# code is:
    public byte[] Convert2Bytes(int[] list)
    if (list == null || list.Length == 0)
    return new byte[0];
    byte[] data = new byte[list.Length * 4];
    int k = 0;
    for (int i = 0; i < list.Length; i++)
    byte[] intBytes = BitConverter.GetBytes(list);
    for (int j = intBytes.Length - 1; j >= 0; j--)
    data[k++] = intBytes[j];
    return data;
    I tryied to convert the TSQL code to PL/SQL and thats what I've got:
    FUNCTION GetTableInt(p_Data blob)
    RETURN t_array --t_array is table of int
    AS
    l_Ptr number;
    l_Length number;
    l_ID number;
    l_data t_array;
    BEGIN
         l_Length := dbms_lob.getlength(p_Data);
    l_Ptr := 1;
         WHILE(l_Ptr<=l_Length)
         loop
              l_ID := to_number( DBMS_LOB.SUBSTR (p_Data, 4, l_ptr));
              IF(l_ID<-2147483646)THEN
                   IF(l_ID=-2147483648)THEN
                        l_ID := NULL;
                   ELSE
                        l_Ptr := l_Ptr + 4;
                        l_ID := to_number( DBMS_LOB.SUBSTR(p_Data, 4,l_ptr));
                   END IF;
                   END IF;
    l_data(l_data.count) := l_ID;
              l_Ptr := l_Ptr + 4;
         END loop;
         RETURN l_data;
    END GetTableInt;
    This isn't work.
    This is the error:
    Error report:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    06502. 00000 - "PL/SQL: numeric or value error%s"
    I think the problem is in this line:
    l_ID := to_number( DBMS_LOB.SUBSTR (p_Data, 4, l_ptr));
    but I don't know how to fix that.
    Thanks,
    MTs.

    I'd found the solution.
    I need to write:
    l_ID := utl_raw.cast_to_binary_integer( DBMS_LOB.SUBSTR(p_Data, 4,l_ptr));
    instead of:
    l_ID := to_number( DBMS_LOB.SUBSTR (p_Data, 4, l_ptr));
    The performance isn't good, it's take 2.8 sec to convert 5000 int, but it's works.

  • Converting bytes to pixels???

    Hi Everyone,
    My Jdev version is 11.1.2.3.0.
    I have deloped one ADF applicaton which is working fine.
    Now i have added a table to the page which has 3 columns. The width of the column in ADF page should be equal to width of the column in the database.
    How can i convert bytes to pixels in my ADF page.
    The three column's width in database are: 200Bytes, 250Bytes, 150Bytes. Now i need to specify the width in pixels in ADF.
    how can i do that?
    Any ways to do that?
    Thanks.

    Yeah I meant e[i] - sorry about that.
    When you say "diagram the to / from arrays" do you mean you want to see their definition & initialisation? If so, please see below:
    numBands, length & width are the three fields read in from the image header.
    byte[] imageDataByte = new byte[numBands * length * width];
              ra.read(imageDataByte,0,numBands * length * width);
              int[] iD = new int[numBands * length * width];
              int count = 0;     
              int[] imageData = new int[numBands * length * width];
              for (int x = 0; x < length; x++)
              for (int y = 0; y < numBands; y++)
              for (int z = 0; z < width; z++)
                   imageData[(length*z+x) + (length* width*y)] += imageDataByte[(length*z+x) + (length* width*y)] << ((length*z+x) + (length* width*y)*512);     
                   count = count + 1;
                   System.out.println(count + ": " + imageData[(length*z+x) + (length* width*y)]);
    Any help would be greatly appreciated.
    Many thanks,
    CG.

  • Conversion from DEC forms on VAX to Forms5/6i

    Hi ,
    The requirement is to migrate around 140 DEC forms on VAX platform to Oracle Forms. Is there any tool which does the same. If so we have to consider the feasibility of tool based approach compared to manual development of the forms.
    Even after conversion, the application will be running on character mode screens only. Some more people who have been working on this found a way to parse the IFDL files (the programs for DEC forms) to get details in ASCII format. This can give some information regarding the fields on forms, validations, etc. But this has to be in a format acceptable for Oracle Forms. Maybe, the feature of converting from text to binary (FMT to FMB) in Oracle forms can be used to generate the forms based on the details got from DEC forms. For this we need to understand thoroughly the format for FMT acceptable for character based forms. Based on this the feasibility to convert the IFDL details to FMT using a tool can be analyzed.
    If anyone is having some idea to solve my problem then it would be a great help to me.
    Regds
    Pattnaik
    null

    The documents can be found on Oracle Technology Network -> Documentation -> Developer Suite -> Forms Developer.
    http://otn.oracle.com/docs/products/forms/content.html
    Hope that helps.

  • I want to convert date from Microsoft Access to Oracle.

    I want to convert date from Microsoft Access to Oracle.
    My Oracel date format is 21-Jul-2004 02:24:09 AM
    I use sqlldr in Oracle 9i Database and I
    write control file
    load data
    infile 'test.txt'
    into table test
    fields terminated by "," optionally enclosed by '"'
    trailing nullcols
    name,
    birthday
    data file 'test.txt' for input
    "dao","21-Jul-2004 02:24:09 AM"
    why did error? ORA-01843: not a valid month
    Thank.

    replace birthday with
    birthday "to_date(:birthday, 'DD-Mon-YYYY HH:MI:SS AM', 'NLS_LANGUAGE=''american''')"Of course, if your monthes are in German, then set the language to german (JUL=JUL but DEZ<>DEC)
    Regards
    Laurent

  • How do I convert byte[] to String?

    I've got a class that pulls information from a GPS receiver on a COM port. That works fine, but the information I'm getting from the port is in the following format:
    Reading serial port...
    44,44,52,46,50,44,77,44,45,51,52,46,50,44,77,44,44,48,48,48,48,42,120,30,-104,-128,96,120,96,0,-26,126,-98,-104,-98,0,30,-122,6,30,-122,6,120,-122,-32,-122,-32,-122,-32,-122,-32,-122,-32,-122,-32,-122,-32,-122,-32,-122,-32,-122,-32,120,-122,-32,-122,-32,-122,-32,-122,-104,-122,6,120,6,-98,30,-104,-128,96,120,96,0,-26,24,-26,-26,-104,30,30,-122,24,120,-32,120,30,102,120,-26,120,-26,-4,48,50,52,44,86,44,52,48,53,54,46,49,50,50,49,44,78,44,48,55,51,53,52,38,54,70,70,-58,118,-115,25,25,89,70,6,102,6,-122,-58,-58,-58,-26,83,102,-122,
    -61,-31,
    36,71,80,71,71,65,44,50,49,52,53,53,54,46,48,50,52,44,52,48,53,54,46,49,50,50,49,44,78,44,48,55,51,53,52,46,50,51,52,52,44,87,44,48,44,48,48,44,44,52,46,50,44,77,44,45,51,52,46,50,44,77,44,44,48,48,48,48,42,52,66,13,10,36,71,80,71,83,
    65,So it's pretty obvious that it's spitting out ASCII values, so I changed the code a bit to print out the corresponding letters instead:
    Reading serial port...
    $GPGGA,214724.031,4056.1221,N,07354.2344,W,0,00,,4.2,M,-34.2,M,,0000*48
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPGSV,3,1,11,31,70,286,,14,57,089,,32,51,293,,30,44,061,*7D
    $GPGSV,3,2,11,05,24,046,,22,23,167,,20,20,315,,16,15,194,*70
    $GPGSV,3,3,11,12,12,039,,29,09,103,,11,00,279,*4F
    $GPRMC,214724.031,V,4056.1221,N,07354.2344,W,,,140608,,,N*68
    $GPGGA,214725.031,4056.1221,N,07354.2344,W,0,00,,4.2,M,-34.2,M,,0000*49
    $GPGSA,A,1,,,,,,,,,,,,,,,*1ENow those are the NMEA sentences that the GPS receiver spits out, that's exactly what I need. Only problem is I'm printing them out using the following code:
          byte[] buffer = new byte[4096];
          InputStream theInput = thePort.getInputStream();
          System.out.println("Reading serial port...");
          while (canRead()) // Loop
            int bytesRead = theInput.read(buffer);
            if (bytesRead == -1)
              break;
            for (int z = 0; z < bytesRead; z++)
                 System.out.print(Character.toString((char)buffer[z]));
            }So as you can see, it's simply taking the byte, converting it from ASCII to a symbol or letter, and putting it on the screen. Then it moves onto the next byte. So what I've tried to do is change it again so that it adds each converted letter to a string value, starting a completely new string every time it hits a $ sign, which always starts a NMEA sentence:
          byte[] buffer = new byte[4096];
          InputStream theInput = thePort.getInputStream();
          System.out.println("Reading serial port...");
          while (canRead()) // Loop
            int bytesRead = theInput.read(buffer);
            if (bytesRead == -1)
              break;
            String s = "";
            for (int z = 0; z < bytesRead; z++)
                 if (Character.toString((char)buffer[z]).equalsIgnoreCase("$") && s.length() > 1)
                      System.out.println(s);
                      s = Character.toString((char)buffer[z]);
                 else
                      s = s + Character.toString((char)buffer[z]);
    //             System.out.print(Character.toString((char)buffer[z]));
    s = "";
    }The problem with this is for some reason the sentences aren't whole, there's line breaks inserted into them. So when I'm passing them to the parser, I'm passing incomplete sentences. Here's the output I'm getting now:
    Reading serial port...
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    .2,M,-34.2,M,,0000*4D
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    ,32,51,293,,30,44,061,*7D
    $GPGSV,3,3,11,12,12,039,,29,09,103,,11,00,279,*4FHow do I get each NMEA sentence into a string so I can send it to a parser? Any ideas?
    Edited by: DeX on Jun 14, 2008 6:02 PM

    Your problem is that you're assuming a newline actually indicates the end of a line.
    Assuming you can't fix the sender (or yell at the maintainer and get him to fix it), take
    advantage of the fact that you know what a valid line starts with and just ignore the newline
    characters.
    Thanks but that gives me the same result. I think my issue is with the multithreading,
    another thread is rolling through and assigning values to the String before the previous
    thread is finished copying the bytes to it. I suggest you take advantage of the StringBuilder class. Also, if you insist on using the
    String(byte[ ]) constructor, you should note that you're assuming a charset, a rather
    dangerous thing to do. Use the String(byte[ ], String) constructor instead and explicitly use US-ASCII.

  • How to display raw, not ascii, bytes from serial port?

    Hello, I have an instrument that outputs raw data, not ascii, bytes to a serial port.  How do you display raw data, not ascii, bytes from a serial port?  Since raw data bytes are not displayable, there is got to be something in labview to interpret/display the received bytes the way it is as data in HEX or Binary.  The STRING-TO-HEX and STRING-TO-BINARY functions are not applicable in this case because the bytes were not string type in the first place.  For example, if the receive byte is 0x4D, I need to display 4D in HEX or 77 in Decimal and not the ascii character "M" corresponding to 0x4D ascii code.  I am using a VISA-RD function currently to receive the data from a COM port.  VISA-RD outputs string type.  Thank for any feedback or suggestion in advance.

    BC@Baxter wrote:
    ...The STRING-TO-HEX and STRING-TO-BINARY functions are not applicable in this case because the bytes were not string type in the first place...
    Of course they are string type, just not formatted in a human readable form. So, YES, these functions are not appropriate.
    BC@Baxter wrote:
    For example, if the receive byte is 0x4D, I need to display 4D in HEX or 77 in Decimal and not the ascii character "M" corresponding to 0x4D ascii code. 
    Dennis is right, but there is no "decimal" display for strings, so the second requirement needs a tiny little bit more code.
    If you have a single byte string, you can typecast it into a U8 number and set the display format as decimal, hex, octal, or binary as desired. In decimal, it would display the number 77. Since it is now a numeric, you can even do math with it.
    In general, the string has multiple bytes, and you would typecast it into an array of U8 numbers (Since this is an often used function, there is also a "string to byte array" which does the same thing).
    Typecasting is the secret. You can e.g. easily typecast 2 bytes into a U16, 4 bytes into a I32, 8 bytes into a DBL,  etc. For more detailed requirements, there is also the "unflatten from string". Check the online help for details. Good luck!
    LabVIEW Champion . Do more with less code and in less time .

  • Function module to convert byte stream to Tiff formate.

    Hi All,
    Is there any function module is there to convert byte stream to Tiff formate.
    Thanks&regds,
    Srinivas.
    Edited by: srinivas balla on Dec 24, 2007 6:28 AM

    try this
    SCP_1TO1_BYTE_CONVERTER_MAP
    Award Points if useful
    bhupal

  • Convert String from ASCII to ANSI

    Hi,
    a command line instruction via LabVIEW function "System Exec.vi" retrieves me a string in ASCII format. Is there a function to convert string from ASCII to ANSII format? I use LabVIEW 8.5 German Installation.
    Kind Regards
    Christian
    Test Engineering
    digades GmbH
    www.digades.com

    Hallo Christian,
    AFAIK there is no such in function in LabView...
    But you can:
    - use "Search and replace string" to search for ASCII chars and replace them by their corresponding ANSI char, do this in a loop for all chars to be replaced (acceptable speed for small strings...)
    - convert the string to an U8 array and use a lookup table to convert all bytes from ASCII to ANSI, convert back to string (may be faster for long strings...)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Cannot be converted in type DEC,CURR - longtext

    Dear,
    When we are loading the data to the targets, we are getting the errors in the Transfer rules like mentioned bellow
    Info source 0EC_CS_1 (Transaction Data for Consolidation)
    Status (tab) :
    Technical : Collection in source system ended
    Processing Step : Processing End
    Details (tab):
    Processing end : Errors occurred
    Error records written to application log
    Error in an arithmetic operation in record 1
    Record 1 :Contents 00 0.0000000 from field PCNT1 cannot be converted in type DEC ->longtext
    Info source 0CO_OM_CCA_9 (Cost Centers: Actual Costs with Delta E)
    Record 39952:Contents 048624.95- 1 from field SWF cannot be converted in type CURR ->longtext
    Kindly help.
    Thanks & Regards,
    Kiran A
    Edited by: Kiran A on Mar 21, 2010 10:23 AM
    Edited by: Kiran A on Mar 21, 2010 11:36 AM

    Hi,
                   It is sure some where in transferrules the mapping wasdone wrongly , like char --char of info object but in ur case some where data element is not same for field and info object.
      check throughly transfer rules correctly field level and infoobject mapping  and activate.
    it is some where currency and unit fields the difference is there for data elements
    Thanks&Regards,
    Sathish
    Edited by: sathish kakumudi on Mar 21, 2010 4:01 PM

  • How to migrate the data from DEC RDB 5.1 to Oracle 11g

    Hi,
    As part of my project, we need to migrate the data from DEC RDB 5.1 present on Alpha server with VMS 6.1 OS into Oracle 11g. The size of the data in DEC RDB is around 40 GB.
    Could you please suggest various ways of getting this done in easy and simpler way?
    Thanks in advance.

    Hello,
    when Oracle bought Rdb from Digital Equipment Corporation (DEC) in 1994, the name of the product changed from DEC Rdb to Oracle Rdb. Meanwhile the actual version of Rdb is 7.2, so you are on a VERY old version. And that excludes the suggestions from the mentioned note to use a database link from Oracle RDBMS to Rdb, that is simply not possible with that old version of Rdb.
    But Rdb 5.1 knew already the Rdb Management Utility (RMU) - I just checked that with Rdb 4.1 which is even older.
    There are two commands that are helpful for your task.
    RMU/EXTRACT - that writes the metadata into a file. That output helps you to build a script to create all the objects in your target database.
    RMU/UNLOAD - that writes the data of each table into a formatted file (one file per table). That output can be used by the SQL*Loader to load your data into the target database.
    You can read all details about these commands in the online help on your Alpha. At first, issue the HELP command and look in the output list whether it lists a command RMU or RMU51. Then run that command:
    $ help rmu /extract
    and
    $ help rmu /unload
    Replace rmu by rmu51 if the help command shows you that rmu51 exists but not rmu.
    There is one caveat. Do you use blobs in your Rdb database? If you don't know that, create an the output with RMU/EXTRACT and search the output file for the string LIST OF BYTE VARYING. If there are none then you have no blobs. If you have some you need to take more care of them, they can't be unloaded into a formatted file, that must happen programmatical. If you have such fields then let me know, then I'll tell you how to get them out of your Rdb database.
    Best regards
    Wolfgang
    P.S.: For Rdb related questions it is better to ask in our Communities at https://communities.oracle.com/portal/server.pt/community/rdb_product_family_on_openvms . That forum is watched by Rdb Support and Development.

  • Cutting first few byte from Large files

    Hi,
    I have a requirement to cut out first 20 bytes from very large binary files (in the order of 1-4 GB).
    I was looking at RandomAccessFile and FileChannel to accomplish this. But still, it seems that there will be a lot of I/O involved as it will be practically copying over the remaining bytes to another file only.
    Is there any other approach which doesn't cause a lot of disk I/O.
    Thanks.

    >
    I have a requirement to cut out first 20 bytes from very large binary files (in the order of 1-4 GB).
    >
    Somehow I suspect your 'requirement' isn't telling us the whole picture. If you can explain what the purpose of that requirement is there might be a couple of options.
    >
    replace the first 20 bytes with values that won't interfere with how the file needs to be used.
    >
    One reason might be becaue the files need to be read and processed and the first 20 bytes will interfere with that processing. Depending on the tool that will read the file you might be able to replace the 1st 20 bytes with NULLS (0 hex), SPACES, or some other set of values that the tool will ignore or silently fail on and continue.
    It would be very fast to replace 20 bytes in each file with some other value.
    Second option could be use a file filter that strips off the first 20 bytes when the file is read. Again this depends on the tool being used to read the file.
    In *nix systems you could have a small filter that reads the files, strips of the first 20 bytes and pipes its output into the tool you are using to read the actual file.
    If Java were the tool doing the reading it is even simpler. Just open the RandomAccessFile and move the file pointer to where you want it before the first read.
    A third option is to modify the process that delivers the files to you to strip of the first 20 bytes. If the files are being delivered by FTP you could easily add a filter to do this.
    Fourth option is to have the file supplier zip up the files for you. You can easily add a filter to the process to strip the 20 bytes as the file is being zipped. If these are files that will be kept and moved around the compression will save space and transmission time and you can sneak a filter in for free.
    Can you tell us how the files will actually be used?

  • Need to convert  Date from calendar to String in the format dd-mom-yyyy

    Need to convert Date from calendar to String in the format dd-mom-yyyy+..
    This is absolutely necessary... any help plz..
    Rgds
    Arwinder

    Look up the SimpleDateFormat class: http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
    Arwinder wrote:
    This is absolutely necessary... any help plz..For you maybe, not others. Please refrain from trying to urge others to answer your queries. They'll do it at their own pace ( if at all ).
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

Maybe you are looking for

  • Posting to a servlet from a class in a jar on the server

    I'm trying to modify a 3rd party applet that displays documents pulled from a database to post back to the server whenever the user pages up/down into a new document. The primary functionality of the applet is in place and working, the only change I

  • Cinema 20 and Samsung T240HD problem

    I have a Apple Cinema Display 20 and a Samsung T240HD connected to my G4 MDD Dual 1.25. The Cinema is connected to the ADC connector and the Samsung to the DVI connector of a Radeon 9000 Pro Graphics card. The Samsung is connected via a DVI to DVI ca

  • Isradobeform iview

    Hi,      The Adobe forms are technically part of the Web Dynpro application IsrForm in the Development Component (DC) ISR from the Software Component PCUI_GP. If you want to use custom scenarios with Adobe forms in your Enterprise Portal, you need to

  • Unable to install with Windows 7 and IE9 x64bit,

    I got a new PC to day , and I want to download Itunes. When I download it looks ok, but when the computer is trying to install I got this warning message: "Can not open this installasionpakkage,Control that the package excists and the axcess to it, o

  • Iphone keeps on rebooting itself

    My phone keeps rebooting & can't recharge, how to solve this problem??