Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java Enterprise Code Formatter

Name: Anonymous 2011-12-09 16:44

    package enterprise
;   class Main
{   public static void main(java.lang.String[]commandLineArgumentArray)
{   java.io.OutputStream output=null
;   java.io.InputStream input=null
;   if(commandLineArgumentArray.length>0)
{   try
{   input=new java.io.FileInputStream(new java.io.File(commandLineArgumentArray[0]))
;  
}   catch(java.io.FileNotFoundException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}   if(commandLineArgumentArray.length==1)
{   output=java.lang.System.out
;  
}   else if(commandLineArgumentArray.length==2)
{   try
{   output=new java.io.FileOutputStream(new java.io.File(commandLineArgumentArray[1]))
;  
}   catch(java.io.FileNotFoundException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}  
}   else
{   java.io.BufferedWriter stdout=new java.io.BufferedWriter(new java.io.OutputStreamWriter(new java.io.BufferedOutputStream(java.lang.System.out)))
;   int[]message=
{   85,115,97,103,101,58,32,106,97,118,97,32,45,106,97,114,32,101,110,116,101,114,112,114,105,115,101,102,111,114,109,97,116,116,101,114,46,106,97,114,32,91,73,78,80,85,84,32,70,73,76,69,93,32,91,79,85,84,80,85,84,32,70,73,76,69,93,10,77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,115,32,100,101,102,97,117,108,116,32,116,111,32,115,116,100,105,110,47,115,116,100,111,117,116,10
}  
;   for(int c:message)
{   try
{   stdout.write(c)
;  
}   catch(java.io.IOException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}  
}   try
{   stdout.flush()
;   stdout.close()
;  
}   catch(java.io.IOException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}   java.lang.System.exit(1)
;  
}  
}   else if(commandLineArgumentArray.length==0)
{   input=java.lang.System.in
;   output=java.lang.System.out
;  
}   enterprise.JavaCodeFormatterFactory formatterFactory=enterprise.JavaCodeFormatterFactory.getNewFactory()
;   enterprise.EnterpriseJavaCodeFormatter enterpriseFormatter=formatterFactory.getEnterpriseFormatterForInputAndOutputStreams(input,output)
;   try
{   enterpriseFormatter.format()
;   enterpriseFormatter.write()
;   enterpriseFormatter.close()
;  
}   catch(java.io.IOException e)
{   e.printStackTrace()
;   java.lang.System.exit(1)
;  
}   return
;  
}  
}  
;   class JavaCodeFormatterFactory
{   public EnterpriseJavaCodeFormatter getEnterpriseFormatterForInputAndOutputStreams(java.io.InputStream input,java.io.OutputStream output)
{   return new enterprise.EnterpriseJavaCodeFormatter(new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.BufferedInputStream(input))),new java.io.BufferedWriter(new java.io.OutputStreamWriter(new java.io.BufferedOutputStream(output))))
;  
}   public static enterprise.JavaCodeFormatterFactory getNewFactory()
{   return new enterprise.JavaCodeFormatterFactory()
;  
}   private JavaCodeFormatterFactory()
{  
}  
}  
;   class EnterpriseJavaCodeFormatter
{   private java.io.BufferedReader mInput=null
;   private java.io.BufferedWriter mOutput=null
;   private java.lang.StringBuilder mBuffer=null
;   public EnterpriseJavaCodeFormatter(java.io.BufferedReader input,java.io.BufferedWriter output)
{   this.mBuffer=new java.lang.StringBuilder()
;   this.mInput=input
;   this.mOutput=output
;  
}   public void format()throws java.io.IOException
{   int last=-1
;   int next=-2
;   int c=-1
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   while((c=this.mInput.read())!=-1)
{   if(next!=-1)
{   this.mInput.mark(1)
;   next=this.mInput.read()
;   this.mInput.reset()
;  
}   if(last==10&&(c==32||c==13||c==9))
{   continue
;  
}   if((c==32||c==9||c==10||c==13)&&((!(last<123&&last>94)&&!(last<91&&last>64))||(!(next<123&&next>94)&&!(next<91&&next>64))))
{   continue
;  
}   if(next==47&&c==47)
{   while((c=this.mInput.read())!=10)
;   last=c
;   continue
;  
}   if(c==47&&next==42)
{   last=-1
;   int temp=c
;   c=this.mInput.read()
;   while((c=this.mInput.read())!=-1)
{   if(c==47&&last==42)
{   break
;  
}   last=c
;  
}   last=temp
;   continue
;  
}   if(c==34)
{   do
{   this.mBuffer.append((char)c)
;  
}   while((c=this.mInput.read())!=34)
;  
}   if(c==59||c==123||c==125)
{   this.mBuffer.append((char)10)
;   this.mBuffer.append((char)c)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   this.mBuffer.append((char)32)
;   last=c
;   continue
;  
}   this.mBuffer.append((char)c)
;   last=c
;  
}  
}   public void write()throws java.io.IOException
{   for(int iterator=0
;   iterator<this.mBuffer.length()
;   iterator=iterator+1)
{   this.mOutput.write((int)this.mBuffer.charAt(iterator))
;  
}  
}   public void close()throws java.io.IOException
{   this.mInput.close()
;   this.mOutput.flush()
;   this.mOutput.close()
;  
}   public java.lang.String toString()
{   return this.mBuffer.toString()
;  
}  
}

Name: Anonymous 2011-12-21 18:57

>>41
/vip/ is shit.

Name: Anonymous 2011-12-22 6:43

>>42
You're shit.

Name: Anonymous 2011-12-22 7:53

>>43
You're shit is shit.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List