mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-20 02:15:33 +00:00
More documentation.
This commit is contained in:
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash;
|
||||
|
||||
import com.jpexs.helpers.SwfHeaderStreamSearch;
|
||||
import com.jpexs.helpers.streams.SeekableInputStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -26,23 +27,41 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
* Binary search SWF bundle
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class BinarySWFBundle implements Bundle {
|
||||
|
||||
/**
|
||||
* SWF search
|
||||
*/
|
||||
private final SWFSearch search;
|
||||
|
||||
/**
|
||||
* Constructs a new BinarySWFBundle.
|
||||
* @param is Input stream
|
||||
* @param noCheck Do not check
|
||||
* @param searchMode Search mode
|
||||
* @throws IOException
|
||||
*/
|
||||
public BinarySWFBundle(InputStream is, boolean noCheck, SearchMode searchMode) throws IOException {
|
||||
search = new SWFSearch(new SwfHeaderStreamSearch(is), noCheck, searchMode);
|
||||
search.process();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets size of the search.
|
||||
* @return Size of the search
|
||||
*/
|
||||
@Override
|
||||
public int length() {
|
||||
return search.length();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets keys.
|
||||
* @return Keys
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getKeys() {
|
||||
Set<String> ret = new LinkedHashSet<>();
|
||||
@@ -52,6 +71,11 @@ public class BinarySWFBundle implements Bundle {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets openable.
|
||||
* @param key Key
|
||||
* @return Openable
|
||||
*/
|
||||
@Override
|
||||
public SeekableInputStream getOpenable(String key) {
|
||||
if (!key.startsWith("[")) {
|
||||
@@ -69,6 +93,10 @@ public class BinarySWFBundle implements Bundle {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all.
|
||||
* @return Map of string to seekable input stream
|
||||
*/
|
||||
@Override
|
||||
public Map<String, SeekableInputStream> getAll() {
|
||||
Map<String, SeekableInputStream> ret = new LinkedHashMap<>();
|
||||
@@ -78,16 +106,30 @@ public class BinarySWFBundle implements Bundle {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets extension.
|
||||
* @return Extension
|
||||
*/
|
||||
@Override
|
||||
public String getExtension() {
|
||||
return "bin";
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if read only.
|
||||
* @return True if read only, false otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces openable.
|
||||
* @param key Key
|
||||
* @param is Input stream
|
||||
* @return True if successful, false otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean putOpenable(String key, InputStream is) {
|
||||
throw new UnsupportedOperationException("Save not supported for this type of bundle");
|
||||
|
||||
Reference in New Issue
Block a user