Thanks Glen and Anthony. More info was (Help, processing strings >32K)

From: D (noone_at_nowhere.COM)
Date: 11/22/03

  • Next message: Alex Ostrikov: "Close JFrame"
    Date: Sat, 22 Nov 2003 22:52:59 -0000
    
    

    Hi Glen, Anthony.
    I'm currently looking at streams to solve this problem, probably the main
    issue is that I don't come from an OO background.
    Anyway the problem I have is this:
    I have a large string (say 100000 bytes) passed into my routine. I need to
    read this entire string in blocks of 32000 bytes as these will be passed to
    another routine for further processing.
    Now with my limited Java experience my thinking was to use String.substring
    to chop out the necessary sections of data but of course you can't specify a
    starting position greater than the size of an integer so I'm looking at
    streams and readers now but I don't know any techniques for doing what I
    need.

    So what I need is some way of streaming in 32000 bytes of the string to
    another array or string and repeat until the end of the string is reached.

    Many thanks

    Dave

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.542 / Virus Database: 336 - Release Date: 18/11/2003
    

  • Next message: Alex Ostrikov: "Close JFrame"

    Relevant Pages

    • Re: Confusion about I/O Streams
      ... >> that I am definitely dealing with byte streams and that classes for ... > Characters are a higher-level abstraction than bytes. ... >> primitives and Strings to my scratchpad and I'm having trouble finding ... that's fine so far but it is only writing a single String to the ...
      (comp.lang.java.help)
    • Re: TCP/IP Sockets with GNAT.Sockets
      ... the problem is the use of attributes 'Output on arrays which output array bounds before array data. ... and since String is an array, String'Output outputs String bounds before string data. ... you should note that the problem is the same in C: when reading a string from a socket, ... Streams while a Socket package isn't required to give any explanations ...
      (comp.lang.ada)
    • Re: Confusion about I/O Streams
      ... > I have to admit I've never fully understood the different Java I/O streams ... > so I've been reviewing them in the Java Tutorial. ... Characters are a higher-level abstraction than bytes. ... If you've got a String, you can get a bytefrom it using: ...
      (comp.lang.java.help)
    • Re: Best practices for efficient FP string building in CL?
      ... "stupidity" in visualizing sequence operations in terms of recursive ... about efficient, functional string building. ... The nice thing about using streams for functional programmers, ... makes string building look like i/o or message passing ...
      (comp.lang.lisp)
    • Re: UTF-8 practically vs. theoretically in the VFS API
      ... > In short: filenames are byte streams. ... This is the whole benefit to UTF8, ... call multi-byte versions of the standard string functions. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)