Click here to Skip to main content
15,910,872 members
Home / Discussions / Java
   

Java

 
GeneralRe: shock wave [modified] Pin
TorstenH.22-Nov-10 22:38
TorstenH.22-Nov-10 22:38 
GeneralRe: shock wave Pin
nachiket dave22-Nov-10 22:43
nachiket dave22-Nov-10 22:43 
GeneralRe: shock wave Pin
Richard MacCutchan22-Nov-10 23:42
mveRichard MacCutchan22-Nov-10 23:42 
GeneralRe: shock wave Pin
nachiket dave23-Nov-10 0:09
nachiket dave23-Nov-10 0:09 
GeneralRe: shock wave Pin
Richard MacCutchan23-Nov-10 0:43
mveRichard MacCutchan23-Nov-10 0:43 
GeneralRe: shock wave Pin
TorstenH.22-Nov-10 23:56
TorstenH.22-Nov-10 23:56 
AnswerRe: shock wave Pin
David Skelly23-Nov-10 1:58
David Skelly23-Nov-10 1:58 
GeneralRe: shock wave Pin
nachiket dave23-Nov-10 2:03
nachiket dave23-Nov-10 2:03 
i got one program m wrkin on it....m pasting it below....this is to read the contents of swf files


****************************************************************/
package com.anotherbigidea.flash.readers;

import java.io.*;
import com.anotherbigidea.io.*;
import com.anotherbigidea.flash.structs.Rect;
import com.anotherbigidea.flash.*;
import com.anotherbigidea.flash.interfaces.*;
import com.anotherbigidea.flash.writers.SWFWriter;

/**
* Reads a SWF input stream and drives the SWFConsumer interface.
*/
public class SWFReader
{
protected SWFTags consumer;
protected InStream in;
protected InputStream inputstream;

public SWFReader( SWFTags consumer, InputStream inputstream )
{
this.consumer = consumer;
this.inputstream = inputstream;
this.in = new InStream( inputstream );
}

public SWFReader( SWFTags consumer, InStream instream )
{
this.consumer = consumer;
this.in = instream;
}

/**
* Drive the consumer by reading a SWF File - including the header and all tags
*/
public void readFile() throws IOException
{
readHeader();
readTags();
}

/**
* Drive the consumer by reading SWF tags only
*/
public void readTags() throws IOException
{
while( readOneTag() != SWFConstants.TAG_END );
}

/**
* Drive the consumer by reading one tag
* @return the tag type
*/
public int readOneTag() throws IOException
{
int header = in.readUI16();

int type = header >> 6; //only want the top 10 bits
int length = header & 0x3F; //only want the bottom 6 bits
boolean longTag = (length == 0x3F);

if( longTag )
{
length = (int)in.readUI32();
}

byte[] contents = in.read( length );

consumer.tag( type, longTag, contents );

return type;
}

/**
* Only read the SWF file header
*/
public void readHeader() throws IOException
{
//--Verify File Signature
if( ( in.readUI8() != 0x46 ) || // "F"
( in.readUI8() != 0x57 ) || // "W"
( in.readUI8() != 0x53 ) ) // "S"
{
throw new IOException( "Invalid SWF File Signature" );
}

int version = in.readUI8();
long length = in.readUI32();
Rect frameSize = new Rect( in );
int frameRate = in.readUI16() >> 8;
int frameCount = in.readUI16();

consumer.header( version, length,
frameSize.getMaxX(), frameSize.getMaxY(),
frameRate, frameCount );
}

public static void main( String[] args ) throws IOException
{
SWFWriter writer = new SWFWriter( System.out );
SWFReader reader = new SWFReader( writer, System.in );
reader.readFile();
System.out.flush();
}
}
GeneralRe: shock wave Pin
nachiket dave23-Nov-10 2:06
nachiket dave23-Nov-10 2:06 
GeneralRe: shock wave Pin
Richard MacCutchan23-Nov-10 3:30
mveRichard MacCutchan23-Nov-10 3:30 
QuestionHow to filter arraylist results in servlet-jsp/jsp-servlet? Pin
Alok Sharma ji21-Nov-10 19:40
Alok Sharma ji21-Nov-10 19:40 
AnswerRe: How to filter arraylist results in servlet-jsp/jsp-servlet? Pin
TorstenH.21-Nov-10 21:24
TorstenH.21-Nov-10 21:24 
GeneralRe: How to filter arraylist results in servlet-jsp/jsp-servlet? Pin
Alok Sharma ji21-Nov-10 23:04
Alok Sharma ji21-Nov-10 23:04 
QuestionBrand New to Java Pin
alrubi0021-Nov-10 5:26
alrubi0021-Nov-10 5:26 
AnswerRe: Brand New to Java Pin
Richard MacCutchan21-Nov-10 6:00
mveRichard MacCutchan21-Nov-10 6:00 
GeneralRe: Brand New to Java Pin
alrubi0021-Nov-10 6:14
alrubi0021-Nov-10 6:14 
GeneralRe: Brand New to Java Pin
Richard MacCutchan21-Nov-10 10:11
mveRichard MacCutchan21-Nov-10 10:11 
GeneralRe: Brand New to Java Pin
Alok Sharma ji21-Nov-10 19:43
Alok Sharma ji21-Nov-10 19:43 
GeneralRe: Brand New to Java Pin
Richard MacCutchan21-Nov-10 22:08
mveRichard MacCutchan21-Nov-10 22:08 
GeneralRe: Brand New to Java Pin
Alok Sharma ji21-Nov-10 23:10
Alok Sharma ji21-Nov-10 23:10 
AnswerRe: Brand New to Java Pin
TorstenH.21-Nov-10 21:16
TorstenH.21-Nov-10 21:16 
AnswerRe: Brand New to Java Pin
Alok Sharma ji21-Nov-10 23:09
Alok Sharma ji21-Nov-10 23:09 
QuestionMessage Removed Pin
20-Nov-10 7:12
mr_plow9920-Nov-10 7:12 
AnswerRe: Help with essentially searching text Pin
Dr.Walt Fair, PE20-Nov-10 12:46
professionalDr.Walt Fair, PE20-Nov-10 12:46 
GeneralMessage Removed Pin
22-Nov-10 5:55
mr_plow9922-Nov-10 5:55 

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.