Click here to Skip to main content
14,838,162 members
Home / Discussions / Java
   

Java

 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
csanuragjain16-Apr-11 22:15
Membercsanuragjain16-Apr-11 22:15 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
Richard MacCutchan17-Apr-11 0:58
mveRichard MacCutchan17-Apr-11 0:58 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
csanuragjain17-Apr-11 2:27
Membercsanuragjain17-Apr-11 2:27 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
Richard MacCutchan17-Apr-11 2:43
mveRichard MacCutchan17-Apr-11 2:43 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
jschell18-Apr-11 8:44
Memberjschell18-Apr-11 8:44 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
csanuragjain18-Apr-11 22:49
Membercsanuragjain18-Apr-11 22:49 
GeneralRe: can we drop packet passing through us and resend it after altering it? Pin
jschell19-Apr-11 8:34
Memberjschell19-Apr-11 8:34 
QuestionTrying to understand this Pin
Waldermort14-Apr-11 8:48
MemberWaldermort14-Apr-11 8:48 
Decompiled a .class (translating to C++) using third party tools (namely Java Decompiler by Emmanuel Dupuy and DJ Java) and also from the bytecode output from javap; all result in the following:

StringBuffer stringbuffer = new StringBuffer();
for(int i = 0; i < stringbuffer.length(); i++)
{
    byte byte0 = (byte)stringbuffer.charAt(i);
    stringbuffer.append((char)byte0);
}


I've been scratching my head for hours trying to figure it out. From what I can see it creates an empty buffer, tests the length (which would be 0) against 0 and skips the loop. Please, somebody, explain it to me.

For completeness sake here is the javap output:

0:   getstatic       #5; //Field a:Z
3:   ifeq    47
6:   new     #4; //class java/lang/StringBuffer
9:   dup
10:  invokespecial   #9; //Method java/lang/StringBuffer."<init>":()V
13:  astore_1
14:  iconst_0
15:  istore_2
16:  goto    36
19:  aload_1
20:  iload_2
21:  invokevirtual   #13; //Method java/lang/StringBuffer.charAt:(I)C
24:  i2b
25:  istore_3
26:  aload_1
27:  iload_3
28:  i2c
29:  invokevirtual   #11; //Method java/lang/StringBuffer.append:(C)Ljava/lang/StringBuffer;
32:  pop
33:  iinc    2, 1
36:  iload_2
37:  aload_1
38:  invokevirtual   #15; //Method java/lang/StringBuffer.length:()I
41:  if_icmplt       19
44:  invokestatic    #12; //Method b:()V
47:  getstatic       #6; //Field b:Z
50:  ifeq    57
53:  iconst_0
54:  putstatic       #6; //Field b:Z
57:  iconst_0
58:  putstatic       #5; //Field a:Z
61:  return

Waldermort

AnswerRe: Trying to understand this Pin
dasblinkenlight14-Apr-11 16:46
Memberdasblinkenlight14-Apr-11 16:46 
GeneralRe: Trying to understand this Pin
Waldermort14-Apr-11 21:47
MemberWaldermort14-Apr-11 21:47 
GeneralRe: Trying to understand this Pin
TorstenH.14-Apr-11 22:10
MemberTorstenH.14-Apr-11 22:10 
GeneralRe: Trying to understand this Pin
Waldermort15-Apr-11 0:40
MemberWaldermort15-Apr-11 0:40 
AnswerRe: Trying to understand this Pin
CodingLover14-Apr-11 18:24
MemberCodingLover14-Apr-11 18:24 
QuestionUnable to load C# Dlls from Java Application Pin
Vodka_Chill14-Apr-11 3:02
MemberVodka_Chill14-Apr-11 3:02 
AnswerRe: Unable to load C# Dlls from Java Application Pin
Richard MacCutchan14-Apr-11 5:29
mveRichard MacCutchan14-Apr-11 5:29 
AnswerRe: Unable to load C# Dlls from Java Application Pin
jschell14-Apr-11 9:49
Memberjschell14-Apr-11 9:49 
QuestionIWAB0379E Unable to open http://localhost:8080/WebServiceProject/CalculatorPort?WSDL Pin
R V Reddy13-Apr-11 22:29
MemberR V Reddy13-Apr-11 22:29 
AnswerRe: IWAB0379E Unable to open http://localhost:8080/WebServiceProject/CalculatorPort?WSDL Pin
David Skelly14-Apr-11 1:43
MemberDavid Skelly14-Apr-11 1:43 
Questionsent from J2ME to webServer Pin
williamroma13-Apr-11 10:21
Memberwilliamroma13-Apr-11 10:21 
AnswerRe: sent from J2ME to webServer Pin
CodingLover14-Apr-11 18:26
MemberCodingLover14-Apr-11 18:26 
GeneralRe: sent from J2ME to webServer Pin
williamroma15-Apr-11 0:16
Memberwilliamroma15-Apr-11 0:16 
GeneralRe: sent from J2ME to webServer Pin
CodingLover15-Apr-11 8:28
MemberCodingLover15-Apr-11 8:28 
Questionhow to perform drag and drop funtion Pin
manoj_indits12-Apr-11 22:01
Membermanoj_indits12-Apr-11 22:01 
AnswerRe: how to perform drag and drop funtion Pin
TorstenH.12-Apr-11 22:19
MemberTorstenH.12-Apr-11 22:19 
QuestionTo develope own Java IDE Pin
manoj_indits12-Apr-11 21:54
Membermanoj_indits12-Apr-11 21:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.