How to read a mixed text and binary random-access file?

I have a PDF file which I want to decode. The format is a mixture of binary data and text. What I need is to position the file to a particular position, and then to read from that point as a stream either a set of binary bytes or straight ASCII text. I can't see how to do this (if in fact it's possible).
I can open the file as a SeekableByteChannel and position it, but opening a stream repositions the file to the beginning - just what I don't want.
Is there any way of opening a stream from part-way through a file?

I think that I gave this topic a rather misleading title. What it really should be is "How to turn a random access file into a stream"?
I realise that I can open an InputStream and skip the relevant number of characters - but this is highly inefficient on a large file where I will skipping about within the file. I need a stream so that I can apply other stream functions to it - buffering in memory will I suspect be too big.

Similar Messages

  • How do I mix text and Html format in a java mail?

    How do I mix text and Html format in a java mail? some part I want to keep the text format, the other part I want to use Html functions(like fond, color, etc)

    You don't mix them. Pick one or the other.
    However if you want to have a text version and an HTML version, so that mail readers that don't handle HTML can see regular text instead, then you could produce a "multipart/alternative" message. There's an explanation of how to do that in this article:
    http://www-128.ibm.com/developerworks/java/library/x-xmlist2/

  • How to read a whole text file into a pl/sql variable?

    Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

    how to read a whole text file into a pl/sql variable?
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....

  • When I print a webpage from FF how can I make the text and images bigger?

    I am trying to print an eticket for a flight. The text on the schedule comes out too small and the UPC symbol's black lines look ganged together. I know I can view it zoomed up, but how do I make the text and images stay zoomed so they will print out that way?

    I upgraded but the problem remains. At least with Firefox I do have the option to print a selection even if it mangles the top and bottom lines. With Safari or Chrome I have no option to print a selection. At the moment the only way to get a complete copy of the selection is to copy to openoffice etc and print from there.

  • How cna I change the text and background colours in iTunes?

    Can anyone tell me how I can change the text and background colours in iTunes? I am a visually impared user and my main requirement on a PC is to change the colour schemem to white text on a black background. Most software adopts the settings of your colour scheme but iTunes goes it's own and has everything on white backgrounds. I cannot read from white backgrounds (dazzle - that sort of thing). I have never used iTunes for this reason. I have always been a devotee of by far the best media player out there Musicmatch Jukebox, who allow you to edit skins in every detail. However, recently Musicmatch was taken over and users were forced to migrate to the ridiculously poor Yahoo Music Jukebox. A massive downgrade in so many ways.
    I want to use iTunes but will not be able to if I cannot sort this issue out. I downloaded 7.5 before discovering that if you want to use Multi Plugin for skins you need to go back to iTunes 7.02. I've done that, but the skins available are completely pointless to my eyes. They don't change the colours of the main components, just the graphical bit at the top.
    What I need to do is change the background of the main browser windows so that they are black and the text is white (you know the track lists and tree views, etc). This must be a very simple case of just changing the codes somewhere, but I can't find where. I read somewhere that you need to hack into something call ResourceDB inside a file called iTunes.jar. There is no such file on my PC. Could that be a Mac thing?
    Please help someone if you can. I would like to become an iTunes user. There seems to be more music available than on Napster which I currently use.
    Thanks in advance
    Z

    In my opinion, it seems that Apple has decided to sacrifice usability so that iTunes would look more like a Mac application. You are probably already aware that using Windows' built-in high-contrast settings do not work in iTunes.
    I did some hacking at the resource file a while back, but I was unable to figure out how to change the color of the background. IIRC there was a resource whose description indicated it would change the background color, but when I changed the resource, nothing happened.
    I was, however, able to figure out how to make the "large" font much larger (any size you want, I suppose). Will that help? See
    http://home.comcast.net/~teridon73/ituneshacks/index.html
    You should provide feedback to Apple:
    http://www.apple.com/feedback/
    I don't think it is too harsh to call it "shameful" that Apple has chosen this design path. Where I work, we are required to make ALL applications (or any computer interface, such as a website) section 508 compliant. Of course, I'm being a bit of a hypocrite, because I've made no effort to make my website compliant. If you have trouble reading it, please let me know.

  • How to read line number text from PDF using plugin?

    Hi, I would like to know how to read line number text from PDF using plugin?
    Thanks in advance.

    Ok, some background reading of the PDF Reference will help you understand why this is so difficult. PDF files are not organised into lines. It is best to think of each word or character on the page as being a graphic with its own position. The human eye sees lines where a series of graphics (words) are roughly in the same horizontal region.
    In the general case it is difficult or even impossible to answer this. You may have columns with different spacing (but the PDF stores no information on what is a column). You may have subscripts and superscripts. You may have text in graphics coinciding with other text. Commonly, there may be titles, headings or page numbers which are just ordinary text and might count as lines.
    That said, what you need to do is extract the text on the page and its positions. The WordFinder APIs are the way to do that. Now, sort all the words out, using the Y coordinates and size to try and guess what makes a "line". Now you are in a position to find the text (divided into words, not strings) and report the "line number" you have estimated.

  • How to read the whole text file lines using FTP adapter

    Hi all,
    How to read the whole text file lines when error occured middle of the text file reading.
    after it is not reading the remaining lines . how to read the whole text file using FTP adapter
    pls can you help me

    Yes there is you need to use the uniqueMessageSeparator property. Have a look at the following link for its implementation.
    http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_file.htm#CIACDAAC
    cheers
    James

  • How to read to PO text

    Hi Experts,
    I need to read Purhcase order texts like Header note and Header text what is the Value i must specify For TDID in Read_Text function module to read the Header text and header note. In table TTXID there are many values for header text and header note.

    Hi
    DOuble click on the Text in the PO
    it will navigate to text editor
    from menu GOTO-> HEADER
    there you will see the ID,NAME,OBJECT and LANG paramters
    The ID will change for different texts
    For Header texts the same ID will be there(one Table like EKKO) and the OBJECTNAME will be the PO number
    for all Item texts one OBJECT (like EKPO) will be there
    and the OBJECT NAME will be the concatenation of PO + ITEM no.
    READ_TEXT
    READ_TEXT provides a text for the application program in the specified work areas.
    The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
    After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
    If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
    Function call:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING CLIENT = SY-MANDT
    OBJECT = ?...
    NAME = ?...
    ID = ?...
    LANGUAGE = ?...
    ARCHIVE_HANDLE = 0
    IMPORTING HEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    NOT_FOUND =
    OBJECT =
    REFERENCE_CHECK =
    WRONG_ACCESS_TO_ARCHIVE =
    Export parameters:
    CLIENT
    Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
    Reference field: SY-MANDT
    Default value: SY-MANDT
    OBJECT
    Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
    Reference field: THEAD-TDOBJECT
    NAME
    Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
    Reference field: THEAD-TDNAME
    ID
    Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
    Reference field: THEAD-TDID
    LANGUAGE
    Enter the language key of the text module. The system accepts only languages that are defined in table T002.
    Reference field: THEAD-TDSPRAS
    ARCHIVE_HANDLE
    If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
    The value '0' indicates that you do not want to read the text from the archive.
    Reference field: SY-TABIX
    Default value: 0
    Import parameters:
    HEADER
    If the system finds the desired text, it returns the text header in this parameter.
    Structure: THEAD
    Table parameters:
    LINES
    The table contains all text lines that belong to the text read.
    Structure: TLINE
    Exceptions:
    ID
    The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
    LANGUAGE
    The parameter LANGUAGE contains a language key that does not exist in table T002.
    NAME
    The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
    Possible errors:
    The field contains only blanks.
    The field contains the invalid characters ‘*’ or ‘,’.
    OBJECT
    The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
    NOT_FOUND
    The system did not find the specified text module.
    REFERENCE_CHECK
    The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
    WRONG_ACCESS_ TO_ARCHIVE
    The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How do you add full folders and not just individual files in the new itunes?

    How do you add full folders and not just individual files in new itunes? i just reformatted my HD and went to add all my music and it's only letting me add files not folders!?!?

    "Add Folder to Library" is still in the file menu, but you might need to bring up the menu bar to see the file menu.
    If you're using 11.0.x, click on the wee boxy icon up in the top-left corner of your iTunes to see the "Show Menu Bar" control, as per the following screenshot:

  • How shall I use my IMac and MacBookPro, with synchronized files

    Hi, how shall I use my IMac and MacBookPro, with synchronized files? I used to work at home and office with those to machines and finally always have different version of my documents. Is there any dispositive that I should use, where all my files are moving with me? os there is something to synchronized the computers using WiFi or bluetooth?

    The following has instructions: OS X Mavericks: Share your Internet connection

  • In my iPad 3 iOS 6 the icons do not vibrate . How I can remove apps. And the ( lock access code ) not exist in setting / general

    In my iPad 3 iOS 6 the icons do not vibrate . How I can remove apps. And the ( lock access code ) not exist in setting / general

    Did you set any restriction?
    Settings>General>Restriction

  • How can I enable FTP on the DMP and How can I FTP to it and then remove the files that were deployed to the DMP flash?

    How can I enable FTP on the DMP and How can I FTP to it and then remove the files that were deployed to the DMP flash? My platform of DMS is 5.2.2

    Hi Temur, ok. I do the above procedure and it worked fine
    Now, I have other question?
    How can I reproduce any file (for example: a video, an url page, an image), that is in the flash of DMP?
    Índice de ftp://172.17.15.22/tmp/ftproot/tmp/ftproot/tmp/ftproot/usb_1/
    Subir al directorio superior.
    Nombre Tamaño Última modificación
    Sample Videos.lnk
    1 KB
    17/06/2011
    06:25:00 a.m.
    deployment
    29/06/2010
    04:14:00 a.m.
    lost+found
    25/02/2010
    12:00:00 a.m.
    video futbol en la playa.mp4
    1390 KB
    29/06/2010
    01:08:00 a.m.
    videofutbol.mp4
    1390 KB
    29/06/2010
    01:38:00 a.m.
    I like, that el DMP when loss conectivity with DMM, It display at the LCD screen, the video named videofutbol.mp4, this video As I show in the picture above, already in the flash of DMP.
    I appreciate your early response.
    Thanks

  • How to use random access file to access file in disk?

    I have tried to use random access file stream to access the some files saved in disk, but not very successful. I want to know how I can find a particular file in the disk with file locator or sth else.
    Suggestion is highly welcomed, if you have codes to put, I will test it.

    The scenerao is:
    create a randomAccessfile
    write 100 blank records( for future use)
    open this file
    write data to the records inside file
    close the file.
    I will try to put a testing code for you later on.

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How to read in a text file of race lap times....

    How do i read in a text file containing lap times from a race for one driver?
    I have the times down 1 column and look like this.
    I then want to add the times up to get a total race time. I have been looking at the Calendar class and the simpleDateFunction but not sure how to go about it.
    1'43.857
    1'37.860
    1'38.147
    1'37.922
    1'37.662
    1'37.639
    1'37.621
    1'37.728
    1'37.508
    1'37.990
    1'38.114
    1'38.177
    1'38.162
    1'37.847
    1'38.013
    1'38.196
    1'37.963
    1'37.924
    1'38.038
    1'37.962
    Thanks
    Trev

    Considering that your times have non-numerical chars you have no choice but to read them as Strings. Once you have done that you will need to parse the times yourself, ie spilt it into the three separate bits of data. Then you can use the Calendar class if you wish or you can keep a running tally yourself. Just don't forget to tick over seconds when milliseconds reaches 999 and tick over minutes when seconds reach 59.

Maybe you are looking for

  • Custom stylesheet using Eclipse

    Hi friends, I have Developed a project in Eclipse 3.3.2 Created my Theme "TEST". Changed my theme as I need. Then Exported the theme using option " Export to Webdynpro". This created one test.zip and po_ie6.css and ie6.css file. Now tell me how to up

  • How can I get my materials back into EBP 5.5?

    I have executed an initial replication of a single material into a clean EBP 5.5 (SRM 5.0) , i.e. no product master has ever existed After changing MATERIAL filters in R3AC1 and afterwards replicating using R3AS I managed to get more materials into t

  • Self-spawning Movie Clips Don't Run AS2

    Hello, I have made a preloader, and to make the bar appear earlier during the loading process, I made every movie clip except the preloader files have "Export in first frame unchecked." Since I did this, my game doesn't run the movie clips anymore. I

  • I have iphone 5 can i change it from apple and pay the difference bettween both value

    i have iphone 5 can i change it from apple and pay the difference bettween both value

  • Upgrade aborts during Phae RSINDCHK

    Hi, does anybody have an idea: We are upgrading from 46C to ECC6 with Ora 10. I saw a smiliar topic in this forum, I have the same error but the soltion must be different. My filesystem is not full. Error: INDEX PRE-CREATION CHECK Errors and RETURN C