Libobk.so --- 0 Bytes

Hi,
i've read the thread about the 0 byte libs but on my system
sqlplus complains about the libobk.so which is a symbolic link to
libdsbtsh8.so!!!
Is there a patch for this lib ??
What did I wrong ?
Thank you very much
Michael
null

You can find the file libdsbtsh8.so in a "jar" archive in the following directory on the cd:
stage/Components/oracle/rdbms/8.1.5.0.0/1/DataFiles/lib.0.1.jar
Just un-jar the file and copy it to $ORACLE_HOME/lib
Arun ( [email protected] )

Similar Messages

  • How Do I Load An Animated GIF Into PictureBox Control From Byte Array?

    I'm having a problem with loading an animated GIF int a picturebox control in a C# program after it has been converted to a base64 string, then converted to a byte array, then written to binary, then converted to a base64 string again, then converted to
    a byte array, then loaded into a memory stream and finally into a picturebox control.
    Here's the step-by-step code I've written:
    1. First I open an animated GIF from a file and load it directly into a picturebox control. It animates just fine.
    2. Next I convert the image in the picturebox control (pbTitlePageImage) to a base64 string as shown in the code below:
                    if (pbTitlePageImage.Image != null)
                        string Image2BConverted;
                        using (Bitmap bm = new Bitmap(pbTitlePageImage.Image))
                            using (MemoryStream ms = new MemoryStream())
                                bm.Save(ms, ImageFormat.Jpeg);
                                Image2BConverted = Convert.ToBase64String(ms.ToArray());
                                GameInfo.TitlePageImage = Image2BConverted;
                                ms.Close();
                                GameInfo.TitlePageImagePresent = true;
                                ProjectNeedsSaving = true;
    3. Then I write the base64 string to a binary file using FileStream and BinaryWriter.
    4. Next I get the image from the binary file using FileStream and BinaryReader and assign it to a string variable. It is now a base64 string again.
    5. Next I load the base64 string into a byte array, then I load it into StreamReader and finally into the picturebox control (pbGameImages) as shown in the code below:
    byte[] TitlePageImageBuffer = Convert.FromBase64String(GameInfo.TitlePageImage);
                            MemoryStream memTitlePageImageStream = new MemoryStream(TitlePageImageBuffer, 0, TitlePageImageBuffer.Length);
                            memTitlePageImageStream.Write(TitlePageImageBuffer, 0, TitlePageImageBuffer.Length);
                            memTitlePageImageStream.Position = 0;
                            pbGameImages.Image = Image.FromStream(memTitlePageImageStream, true);
                            memTitlePageImageStream.Close();
                            memTitlePageImageStream = null;
                            TitlePageImageBuffer = null;
    This step-by-step will work with all image file types except animated GIFs (standard GIFs work fine). It looks like it's just taking one frame from the animation and loading it into the picturebox. I need to be able to load the entire animation. Does any of
    the code above cause the animation to be lost? Any ideas?

    There is an ImageAnimator so you may not need to use byte array instead.
    ImageAnimator.Animate Method
    http://msdn.microsoft.com/en-us/library/system.drawing.imageanimator.animate(v=vs.110).aspx
    chanmm
    chanmm

  • NetBeans MobilityPack 5 BUG?? how can I send a byte array?

    I�ve created a WebApp and a Simple servlet with one public method.
    public byte[] getStr(byte[] b) {       
    String s = "A string";
    return s.getBytes();
    Then I've used "Mobile To Web App" wizard to generate stubs to that getStr method. And when I�ve tried to call that getStr method:
    byte[] aByte = "st".getBytes();
    byte[] b = client.getStr(aByte);
    I've got an error at Server in Utility.java in generated ReadArray method.
    * Reads an array from the given data source and returns it.
    *@param source The source from which the data is extracted.
    *@return The array from the data source
    *@exception IOException If an error occured while reading the data.
    public static Object readArray(DataInput in) throws IOException {
    short type = in.readShort();
    int length = in.readInt();
    if (length == -1) {
    return null;
    } else {
    switch (type) {
    case BYTE_TYPE: {
    byte[] data = new byte[length];
    in.readFully(data);
    return data;
    default: {
    throw new IllegalArgumentException("Unsupported return type (" + type + ")");
    At this line "in.readFully(data);" I�ve got an EOFException.
    The the aByte = "st".getBytes(); was 2bytes long and at the server "int length = in.readInt();" it was 363273. Why?
    All code was generated by NetBeans Mobility pack 5 it's not mine so its a bug?
    How can I fix this?

    I found that bug. I've described it here
    http://www.netbeans.org/issues/show_bug.cgi?id=74109
    There's a solution how to fix the generated code.

  • View images in a datatable from byte[]

    I am trying to view images in a datatable where the image is
    a byte[]. This is what I tried... doesn't work.
    <h:dataTable rows="5" value="#{AirportList.airportList}" var="airport" binding="#{AirportList.airportData}">
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportCode"/>
                </f:facet>
                <h:outputText value="#{airport.airportCode}"/>
              </h:column>
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportMap"/>
                </f:facet>
                  <h:inputHidden id="ole" value="#{airport.airportMap}"/>
                  <h:outputText value="#{AirportList.myMap}"/>
                 <div>
                 <!--
                      try
                        byte[] pic = (byte[])request.getAttribute("AirportList.myMap");
                        response.setContentType("image/jpeg");
                        OutputStream os = null;
                        os = response.getOutputStream() ;
                       // os.write(pic);
                        os.close();
                        os = null;
                      catch (Exception ex)
                        out.println("Exception: " + ex.getMessage());
                        ex.printStackTrace();
                   -->
                  </div>
              </h:column>
              <h:column>
                <f:facet name="header">
                  <h:outputText value="airportSugBook"/>
                </f:facet>
                <h:outputText value="#{airport.airportSugBook}"/>
              </h:column>
            </h:dataTable>

    my backing code
    public class Airport
      Collection AirportList;
      private UIData AirportData;
      byte[] MyMap;
      public Airport()
      public Collection getAirportList()
        try{
          InitialContext context = new InitialContext();
          AirportLOBLocalHome home =  (AirportLOBLocalHome)context.lookup("java:comp/env/ejb/local/AirportLOBLocal");
          AirportLOBLocal local = home.create();
          AirportList = local.showAirports();
          Iterator it = AirportList.iterator();
          while(it.hasNext())
            ((OtnAirportLobDetailsLocalDTO)it.next()).getAirportMap();
          return AirportList;
        catch(Throwable e)
          e.printStackTrace();
        return null;
      public void setAirportList(Collection AirportList)
        this.AirportList = AirportList;
      public UIData getAirportData()
        return AirportData;
      public void setAirportData(UIData AirportData)
        this.AirportData = AirportData;
      public byte[] getMyMap()
        OtnAirportLobDetailsLocalDTO ap = (OtnAirportLobDetailsLocalDTO)AirportData.getRowData();
        return ap.getAirportMap();
       // return null;
      public void setMyMap(byte[] MyMap)
        this.MyMap = MyMap;
    }

  • The vi is identifyng the number of bytes to be read but the VISA Read vi is not able to read the data from the port.

    We are trying to communicate with the AT106 balance of Mettler Toledo.The VI is attached.
    We are sending in "SI" which is a standard command that is recoginsed by the balance. The balance reads it.The indicator after the property node indicates that there are 8 bytes available on the serial port. However, the VISA read VI fails to read the bytes at the serial port and gives the following error:
    Error -1073807253 occurred at VISA Read in visa test.vi
    Possible reason(s):
    VISA: (Hex 0xBFFF006B) A framing error occurred during transfer.
    The Vi is atttached.
    Thanks
    Vivek
    Attachments:
    visa_test.vi ‏50 KB

    Hello,
    You should also definitely check the baud rates specified; a framing error often occurs when different baud rates are specified, as the UARTs will be attempting to transmit and receive at different rates, causing the receiving end to either miss bits in a given frame, or sample bits more than once (depending on whether the receiving rate is lower or higher respectively). You should be able to check the baud rate used by your balance in the user manual, and match it in your VI with the baud rate parameter of the VISA Configure Serial Port VI.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • How can I create files in unicode format without "byte order mark"?

    Hello together,
    I have to export files in UTF-8 format and have to send them to another partner system which works with linux as operating system.
    I have tried the different possibities to create files with ABAP. But nothing works 100% how I want.
    Some examples:
    1.)
    OPEN DATASET [filename] FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
    If I create a file in this way and download it from application server to local system the result for file format in a unicode text edior like NotePad is "ANSI AS UTF-8". This means I have no BYTE ORDER MARK inside.
    But it is also possible that the file format is only ANSI if the file contains no "special characters", isn't it?
    In my test cases I create 3 files. 2 of them has format "ANSI AS UTF-8", and one only "ANSII".
    After transfer to Linux I get as result 2 times UTF8 and one time ASCII as file format.
    2.)
    OPEN DATASET [filename] FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE ORDER MARK.
    With this syntax the result in local editor looks like ok. I get as format really "UTF-8".
    But I get problems with the system which receives the files.
    All files has the file format UTF-8 on Linux but the interface / script can not read the file with BYTE ORDER MARK.
    This is a very big problem for me.
    Do anybody of you know if it possible to force creation in UTF-8 without a BYTE ORDER MARK?
    This means more or less the first example but all files should have UTF-8 format!
    Thanks in advance
    Christian

    This means it is not possible to create a pure unicode file without the byte order mark?
    You wouldn't happen to know how a file with byte order mark should read on a Linux system?
    Or if this possible or not?
    Regards
    Christian

  • JMS paging store - what is difference between bytes and messages threshholds?

              You can activate and configure both "bytes paging" and "message paging". What
              is the difference? Why use one or the other or are both required?
              Thanks,
              John
              

    Hi Mr. Black,
              Cool name.
              Message paging is based on number of messages. Bytes paging is based
              on the size of message payload (properties, body, corr-id, and type),
              where the payload does not include the header size. One can set
              either or both -- if both are set, paging kicks in as soon
              as the first threshhold is reached.
              As for which one to use, you may wish to set both. The former
              accounts for large numbers of small messages, and the latter
              handles large messages. (eg 1000 small 10 byte messages
              will charge 10,000 bytes toward quota but actually use up
              128,000 bytes of JVM memory once the header is thrown in...)
              Tom
              John Black wrote:
              > You can activate and configure both "bytes paging" and "message
              paging". What
              > is the difference? Why use one or the other or are both required?
              >
              > Thanks,
              > John
              

  • Using a byte[] as a secondary index's key within the Collection's API

    I am using JE 4.1.7 and its Collections API. Overall I am very satisfied with the ease of using JE within our applications. (I need to know more about maintenance, however!) My problem is that I wanted a secondary index with a byte[] key. The key contains the 16 bytes of an MD5 hash. However, while the code compiles without error when it runs JE tell me
    Exception in thread "main" java.lang.IllegalArgumentException: ONE_TO_ONE and MANY_TO_ONE keys must not have an array or Collection type: example.MyRecord.hash
    See test code below. I read the docs again and found that the only "complex" formats that are acceptable are String and BigInteger. For now I am using String instead of byte[] but I would much rather use the smaller byte[]. Is it possible to trick JE into using the byte[]? (Which we know it is using internally.)
    -- Andrew
    package example;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.persist.EntityStore;
    import com.sleepycat.persist.PrimaryIndex;
    import com.sleepycat.persist.SecondaryIndex;
    import com.sleepycat.persist.StoreConfig;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.PrimaryKey;
    import com.sleepycat.persist.model.Relationship;
    import com.sleepycat.persist.model.SecondaryKey;
    import java.io.File;
    @Entity
    public class MyRecord {
    @PrimaryKey
    private long id;
    @SecondaryKey(relate = Relationship.ONE_TO_ONE, name = "byHash")
    private byte[] hash;
    public static MyRecord create(long id, byte[] hash) {
    MyRecord r = new MyRecord();
    r.id = id;
    r.hash = hash;
    return r;
    public long getId() {
    return id;
    public byte[] getHash() {
    return hash;
    public static void main( String[] args ) throws Exception {
    File directory = new File( args[0] );
    EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setTransactional(false);
    environmentConfig.setAllowCreate(true);
    environmentConfig.setReadOnly(false);
    StoreConfig storeConfig = new StoreConfig();
    storeConfig.setTransactional(false);
    storeConfig.setAllowCreate(true);
    storeConfig.setReadOnly(false);
    Environment environment = new Environment(directory, environmentConfig);
    EntityStore myRecordEntityStore = new EntityStore(environment, "my-record", storeConfig);
    PrimaryIndex<Long, MyRecord> idToMyRecordIndex = myRecordEntityStore.getPrimaryIndex(Long.class, MyRecord.class);
    SecondaryIndex<byte[], Long, MyRecord> hashToMyRecordIndex = myRecordEntityStore.getSecondaryIndex(idToMyRecordIndex, byte[].class, "byHash");
    // END

    We have highly variable length data that we wish to use as keys. To avoid massive index sizes and slow key lookup we are using MD5 hashes (or something more collision resistant should we need it). (Note that I am making assumptions about key size and its relation to index size that may well inaccurate.)Thanks for explaining, that makes sense.
    It would be the whole field. (I did consider using my own key data design using the @Persistent and @KeyField annotations to place the MD5 hash into two longs. I abandoned that effort because I assumed (again) that lookup with a custom key design would slower than the built-in String key implementation.)A composite key class with several long or int fields will not be slower than a single String field, and will probably result in a smaller key since the UTF-8 encoding is avoided. Since the byte array is fixed size (I didn't realize that earlier), this is the best approach.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When do WL streams release byte[]. Smaller footprint under JBOSS.

    We have a customer that started having memory issues. When we jprobed, we saw that half the memory usage they were seeing on the client was occupied by the byte[] corresponding to the objects streamed back from the ssb running on the application server. In fact, several calls to different ssbs that return very large amounts of data were responsible for large amounts of data hanging around on the client. I understand that weblogic has to hold onto these data structures to resolve multiple streams of the same object on the server side to the same object on the client. My question is, what controls garbage collection of this data? Under what circumstances will it be released?
    When we ran the same tests under JBOSS the memory footprint was much smaller. If we could understand the BEA mechanism and force the stream to be reset (or do something that indirectly forces the stream to be reset) we would be happy.
    Thoughts?
    Thanks in advance.
    Eric

    Excellent Blog. Thank You
    Small clarification on Step **6) Oracle Home Directory, ...a) Resize the Root Partition**
    Ubuntu 11.10 has Gparted available as a Ubuntu software download, DONT use that while trying the above step, instead download the ISO file from http://sourceforge.net/projects/gparted/files/gparted-live-stable/ gparted-live-0.12.0-5.iso (124.6 MB)
    Burn that ISO file on a Blank DVD, reboot the Ubuntu , during startup select Boot from DVD Option if not already selected. this will take to Boot Menu Options of Gparted Live then select the first menu option, and this allows to do further action such as Re-sizing .
    and once you have chosen and executed step a) . do NOT run step b) also that is "Setup External Storage"
    I hope this minor clarification can avoid some confusion
    Regards
    Madhusudhan Rao
    Edited by: MadhusudhanRao on Mar 24, 2012 11:30 PM

  • A better way to Read Bytes until Done ?

    My question involves reading an unknown number of bytes from the serial
    port. One method is to just wait a defined amount of time to receive
    the bytes and hope you caught all of them. Better: count them until
    they are all received. I have attached an image which shows the method
    I use to count bytes until all bytes are received. However, this method
    is rather slow. It's taking me 500mS to read data that I can normally
    read in 230mS. Is the shift register making this loop slow? Is there a
    better way to read the bytes until all bytes are in?
    Richard
    Attachments:
    ReadBytes.gif ‏5 KB

    Thanks for your reply Chilly.
    Actually, you are correct on both accounts, the delay and the wire from
    the output of Write, and in fact, I usually do those things. I was just
    in a hurry to get an example posted and didn't have my real data.
    To put my issue in broader prospective, I have attached an image that shows boh methods I've used to count bytes. One
    shows the method I use to count bytes until all bytes are received. The
    other is a "hard wired" timer method that I try to avoid, but at least
    it is fast. Notice the text in red. Why would I be able to read the
    byes so much faster in the "hard wired" version? It has to be either
    the shift register, the AND, or the compare functions, and I still
    can't beleive these things would be slower than the Express timer
    function in the other method.
    Methodology: The 235mS timer used in the "hard wired" method was
    emperically derived. The 150 bytes are received 100% of the time when
    235mS is allowed. 230mS yields about 90% of the bytes, the it goes down
    exponentially. I found that the shift register method method trakes
    ~515mS avg by putting a tick count on both sides of the loop and
    finding the resulting time. I also did that with the hard wired method
    and found it to be dead on 235mS which at least proves the Express vi
    works very well
    Message Edited by Broken Arrow on 09-05-2005 08:31 PM
    Message Edited by Broken Arrow on 09-05-2005 08:32 PM
    Richard
    Attachments:
    CoutingBytes.GIF ‏25 KB

  • SocketInputStream.read(byte[], int, int) extremely slow

    Hi everyone,
    I'm trying to send several commands to a server and for each command read one or more lines as response. To do that I'm using a good old Socket connection. I'm reading the response lines with BufferedReader.readLine, but it's very slow. VisualVM says, that SocketInputStream.read(byte[], int, int) is consuming most of the cpu time. A perl script, which does the same job, finishes in no time. So it's not a problem with the server.
    I'm runnning java version "1.6.0_12"
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode) on Linux henni 2.6.25-gentoo-r7 #3 SMP PREEMPT Sat Jul 26 19:35:54 CEST 2008 i686 Intel(R) Core(TM)2 Duo CPU E6550 @ 2.33GHz GenuineIntel GNU/Linux and here's my code
    private List<Response> readResponse() throws IOException {
            List<Response> responses = new ArrayList<Response>();
            String line = "";
            while ( (line = in.readLine()) != null) {
                int code = -1;
                try {
                    code = Integer.parseInt(line.substring(0, 3));
                    line = line.substring(4);
                } catch (Exception e) {
                    code = -1;
                // TODO create different response objects ?!?
                NotImplemented res = new NotImplemented(code, line);
                responses.add(res);
                // we received an "end of response" line and can stop reading from the socket
                if(code >= 200 && code < 300) {
                    break;
            return responses;
        }Any hints are appreciated.
    Best regards,
    Henrik

    Though it's almost an sscce I posted there, I will try to shrink it a little bit:
    Dummy server:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class Server {
        public Server() throws IOException {
            ServerSocket ss = new ServerSocket(2011);
            Socket sock = ss.accept();
            BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));
            PrintStream ps = new PrintStream(sock.getOutputStream());
            ps.println("200 Welcome on the dummy server");
            String line = "";
            while(line != null) {
                line = br.readLine();
                ps.println("200 Ready.");
        public static void main(String[] args) throws IOException {
            new Server();
    }the client:
    import java.io.IOException;
    import java.io.PrintStream;
    import java.net.InetSocketAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.util.Scanner;
    import de.berlios.vch.Config;
    public class Client {
        private Socket socket;
        private PrintStream out;
        private Scanner scanner;
        public Client(String host, int port, int timeout, String encoding)
            throws UnknownHostException, IOException {
            socket = new Socket();
            InetSocketAddress sa = new InetSocketAddress(host, port);
            socket.connect(sa, timeout);
            out = new PrintStream(socket.getOutputStream(), true, encoding);
            scanner = new Scanner(socket.getInputStream(), encoding);
        public synchronized void send(String cmd) throws IOException {
            // send command to server
            out.println(cmd);
            // read response lines
            readResponse();
        public void readResponse() throws IOException {
            while (scanner.hasNextLine()) {
                String line = scanner.nextLine();
                System.out.println(line);
                int code = -1;
                try {
                    code = Integer.parseInt(line.substring(0, 3));
                    line = line.substring(4);
                } catch (Exception e) {
                    code = -1;
                if (code >= 200 && code < 300) {
                    break;
        public static void main(String[] args) {
            try {
                Client con = new Client("localhost", 2011, 500, "utf-8");
                con.readResponse();
                con.send("version 0.1");
                con.send("menu = new menu Feeds");
                con.send("menu.EnableEvent close");
                con.send("menu.SetColorKeyText -red 'Öffnen'");
                for (int i = 0; i < 100; i++) {
                    String groupId = "group"+i;
                    long start = System.currentTimeMillis();
                    con.send(groupId+" = menu.AddNew OsdItem '"+groupId+"'");
                    con.send(groupId+".EnableEvent keyOk keyRed");
                    long stop = System.currentTimeMillis();
                    System.out.println((stop-start)+"ms");
            } catch (Exception e) {
                e.printStackTrace();
    }This code makes me believe, it's not a java problem, but some system setting of my os.

  • Need to convert byte[] to image

    hi frnds,
    i have a byte[](which i got it from an image) i need to convert back to image.Could u pls suggest me how to??
    i tried with Pixelgrabber but i exaclty did get wht shld be the input for it(tried giving image file name). :(
    So pls let me know how and wht to use..ASAP.
    Regards
    subinjava

    Subinjava wrote:
    ..i have a byte[](which i got it from an image) i need to convert back to image.Could u pls suggest me how to??
    Image image = Toolkit.getDefaultToolkit().createImage(byteArray)See http://java.sun.com/javase/6/docs/api/java/awt/Toolkit.html#createImage(byte[]) for more details.

  • Dynamic SQL and 255 bytes per line limit

    I would like to create a Dynamic SQL statement that is longer than 255 bytes. What do I need to do to embed a carriage return or something so that the resultant string is broken up into multiple lines?

    Please ignore. This was a stupid question!

  • MIDP 1.0: Image to byte[] or serializing...

    I would like to extract pixels from a MIDP 1.0 "Image" object through any means possible. I am currently under the impression that "Image.toString()" would just do something lame, like giving me a string like "Image@1234" that identifies the class and the instance -- which could in principle be used for mere instance comparison. Anyhow, if I could serialize an Image object to a file, and then read back the file in to a byte array, then I would be delighted. I want to stress that I don't care how convoluted the approach may be, as long as it is in plain-vanilla J2ME Java code for MIDP 1.0 and is capable of working on an actual device (as opposed to an emulator). Can I cast the Image to Object, and then somehow convert to byte[]? I don't care if I have to get down and dirty, hacking the platform-specific bytes of the full Object manifestation of the Image. Anyhow, I want to make it clear that any hard core hack, doing all kinds of things that would break on different VMs, etc, is totally fine. Messy is fine. I just want access to the binary data of the entire Image object, or, even better (but only icing on the proverbial cake), access to pixel data. If I can get the byte[] representation of Image, then I can hack the rest myself.

    My goal was do a capture of the way things actually rendered on a device, kind of like a "screen capture", only a little more indirect (since I don't think there is a way to get access to the pixels of the LCD). What I have to do is render to an off-screen Image object and then retrieve pixel data from it using the platform-dependent getPixels() supplied by Motorola. You're going to think I'm crazy, but I send this image data to a web server via POSTs, which get collected and stored as a single file on my web server. Voila! A screen capture of how things actually render to an Image object on an actual device.
    Everything works, except...
    I can't get the Motorola "getPixels()" method to work in their emulator, so I'm worried
    that it won't work on my Motorola T720 (something I haven't actually tried, though).
    I get a "Uncaught Exception: java/lang/Error" message from the T720 emulator
    when I run one of the Motorola demos (built using their scripts) when I add the
    following code to the Canvas paint() method:
    if (0 == iDidThis) {  iDidThis = 1;
    try
    {  javax.microedition.lcdui.Image   temp = Image.createImage( 120, 160 );
    int [] rgbData = new int [120*160];
    com.motorola.game.ImageUtil.getPixels ( temp, 0, 0, 1, 1, rgbData );
    System.out.println("Captured Data");
    catch( java.lang.ArrayIndexOutOfBoundsException e )
    {  e.printStackTrace();   } }
    This code runs only once, when the paint() method of the Canvas object is called for
    the first time. Okay, I get the error message, but the "Bounce" demo (to which I added
    the code block above) goes on to run just fine. (NOTE: The message "Captured Data"
    is NOT printed in this scenario.)
    I don't understand why the public static "com.motorola.game.ImageUtil.getPixels()"
    method causes the "java/lang/Error" exception. (By the way, if I comment out the
    call to this method, the code totally works without error, and I see the printed
    statement "Captured Data" in the command window associated with the emulator.)
    If my getPixels() call resulted in bad array access, then I would get the
    java.lang.ArrayIndexOutOfBoundsException exception. But apparently this is
    not what is going on.
    I am really rusty with J2ME, so I don't even know the meaning of "java/lang/Error".
    I assume it is different from a "class not found" exception, but I suspect that my
    problem has to do with a fault in the emulator trying to execute the code for the
    "com.motorola.game.ImageUtil.getPixels()" method.
    My Motorola emulator (v7.5) is from around December, 2002, so it may be really old, and
    maybe this was a known issue at that time that has since been resolved. I'm just never
    tried to use platform-specific J2ME APIs before, so I don't know if what I am observing
    is my fault, or is an emulator issue.
    I'd be grateful for any ideas about what might be going wrong and for ideas about
    possible solutions.

  • Convert XML data to byte array...

    Hello All,
    In my application, i have an XML file and the corresponding XSD file. This XML file is having some date, which i want to convert into an byte[] and then save it in a file. 
    How i can convert the XML data in the byte[]? Here as an example of the xml file and the byte[] data which i want to save in a file.
    <?xml version="1.0" encoding="utf-8"?>
    <HeadersInfo>
    <header>
    <id>0</id>
    <Name>H1</Name>
    </header>
    <header>
    <id>1</id>
    <Name>H2</Name>
    </header>
    </HeasersInfo>
    In the above example 'id' field is of type 'uint' and 'name' field is of type 'string' with max length of '5'. So in this case my byte array should be as shown below:
    00 00 00 01 48 31 00 00 00
    00 00 00 02 48 32 00 00 00
    Here underlines values are for the 'id' parameter where as values in bold are for 'Name' parameter for all the header values in sequence. Name parameter is null (0x00) padded.
    Thanks in advance,
    IamHuM

    Hi,
    the following example extract the id, name values using LINQ To Xml and writes it to a memory stream using a binary writer and returns the result as a byte array:
    internal static byte[] GetXmlAsByteArray()
    var document = XDocument.Parse("<HeadersInfo>"
    + " <header><id>1</id><Name>H1</Name></header>"
    + " <header><id>2</id><Name>H2</Name></header>"
    // additional testing
    + " <header><id>32767</id><Name>H1234</Name></header>"
    + " <header><id>305419896</id><Name>H56789</Name></header>"
    + "</HeadersInfo>");
    const int NameLength = 5; // Max length for a name
    byte[] zeroBytes = new byte[NameLength]; // Helper to fill name
    using (var ms = new MemoryStream())
    using (var writer = new BinaryWriter(ms))
    // write each header
    foreach (var header in document.Root.Elements("header"))
    int id = (int)header.Element("id");
    string name = (string)header.Element("Name");
    byte[] nameBytes = System.Text.Encoding.UTF8.GetBytes(name);
    Console.WriteLine("id: {0}, Name: {1}", id, name);
    // Write id
    writer.Write(GetUIntBytes((uint)id));
    // Write name NameLength (5) max, otherwise padded
    if (nameBytes.Length > NameLength)
    writer.Write(nameBytes, 0, NameLength);
    else
    writer.Write(nameBytes, 0, nameBytes.Length);
    if (nameBytes.Length < NameLength)
    writer.Write(zeroBytes, 0, NameLength - nameBytes.Length);
    byte[] result = ms.ToArray();
    // dump array
    foreach (var value in result)
    Console.Write("{0:X2} ", value);
    Console.WriteLine();
    return result;
    public static byte[] GetUIntBytes(uint value)
    if (BitConverter.IsLittleEndian)
    // swap bytes
    value = ((value & 0x00ff) << 24)
    | ((value & 0xff00) << 8)
    | ((value & 0x00ff0000) >> 8)
    | ((value & 0xff000000) >> 24);
    return BitConverter.GetBytes(value);
    For a general purpose solution you should create a class and split the example into separate methods to extract the data and write the values (integers, strings).
    Regards, Elmar

Maybe you are looking for

  • Retrieving the new entries of an updated ATOM feed/API

    I am using Java servlets to read several ATOM feeds.while reading those feeds below is the problem which i encountered An illustration of the problem ..................... Suppose At 9:00 AM Feed entries are X Y At 9:10 AM Feed entries are a b c X Y

  • How to connect Template project and Implementation project

    Hi Experts,      I would like to know how to connect Template project and Implementation project     in Solution maneger.   Please help. Best regards,    Gaito

  • TS3274 What do I do? My iPad won't turn on at all.

    What do I do? My iPad won't turn on at all even if i put it to charge.

  • Graph in reports -- Values in Y-axes

    hi all, I want to do a Gantt chart principle with in a report to show the employee leaves against thier periods the table structure simply is : EMP_ID EMP_NAME LEAVE_TYPE START_DATE END_DATE so i want the EMP_NAME on the Y-axes , and the calendar dat

  • Control chart limit calculation not being done

    Hi I have maintained MIC, sampling procedure and Insp plan for a char and have made two lots with them. Though charts are being displayed correctly, control limit calculation is not being possible. Msg is "Control limits for track 1 could not be calc