Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: Reading a C struct in java

Reply
Thread Tools

Re: Reading a C struct in java

 
 
Jeff Higgins
Guest
Posts: n/a
 
      10-15-2009
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can *common* struct-members of 2 different struct-types, that are thesame for the first common members, be accessed via pointer cast to either struct-type? John Reye C Programming 28 05-08-2012 12:24 AM
Re: Reading a C struct in java Lothar Kimmeringer Java 45 10-02-2009 04:00 PM
Re: Reading a C struct in java Roedy Green Java 0 09-29-2009 08:38 PM
Reading .Net Web service user defined struct from a Java client Ghislain Tanguay ASP .Net Web Services 0 08-05-2004 01:18 PM
struct my_struct *p = (struct my_struct *)malloc(sizeof(struct my_struct)); Chris Fogelklou C Programming 36 04-20-2004 08:27 AM



Advertisments