Re: Reading a C struct in java

Discussion in 'Java' started by Jeff Higgins, Oct 15, 2009.

  1. Jeff Higgins

    Jeff Higgins Guest

    Mark wrote:
    > Hi,
    > I am writing an app in java which reads data from a socket from a C
    > language program. The data is encoded as a C struct of char arrays
    > something like this;
    >
    > typedef struct {
    > char type[1];
    > char length[6];
    > char acknowledge[1];
    > char duplicate[1];
    > ...
    > } type_t;
    >
    > How can I decode a structure like this in Java without using JNI (a
    > requirement)?


    I see no one has mentioned javolution.io.Struct
    <http://javolution.org/target/site/apidocs/javolution/io/Struct.html>

    I don't know if it would help you.

    JH
    Jeff Higgins, Oct 15, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RA Scheltema
    Replies:
    3
    Views:
    383
    RA Scheltema
    Jan 6, 2004
  2. Chris Fogelklou
    Replies:
    36
    Views:
    1,358
    Chris Fogelklou
    Apr 20, 2004
  3. Lothar Kimmeringer

    Re: Reading a C struct in java

    Lothar Kimmeringer, Sep 29, 2009, in forum: Java
    Replies:
    45
    Views:
    1,741
    Bent C Dalager
    Oct 2, 2009
  4. Roedy Green

    Re: Reading a C struct in java

    Roedy Green, Sep 29, 2009, in forum: Java
    Replies:
    0
    Views:
    387
    Roedy Green
    Sep 29, 2009
  5. Ghislain Tanguay

    Reading .Net Web service user defined struct from a Java client

    Ghislain Tanguay, Aug 5, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    130
    Ghislain Tanguay
    Aug 5, 2004
Loading...

Share This Page