public class JmolBinary extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
DELPHI_BINARY_MAGIC_NUMBER |
static String |
JPEG_CONTINUE_STRING |
(package private) static JmolZipUtility |
jzu |
static String |
PMESH_BINARY_MAGIC_NUMBER |
Constructor and Description |
---|
JmolBinary() |
Modifier and Type | Method and Description |
---|---|
static void |
addZipEntry(Object zos,
String fileName) |
static boolean |
cachePngjFile(FileManager fm,
String[] data) |
static boolean |
checkBinaryType(String fileTypeIn) |
static BufferedInputStream |
checkPngZipStream(BufferedInputStream bis)
looks at byte 51 for "PNGJxxxxxxxxx+yyyyyyyyy"
where xxxxxxxxx is a byte offset to the JMOL data
and yyyyyyyyy is the length of the data.
|
static void |
closeZipEntry(Object zos) |
static String |
determineSurfaceFileType(BufferedReader bufferedReader) |
static String |
determineSurfaceTypeIs(InputStream is) |
static String |
fixUTF(byte[] bytes) |
static void |
getAllZipData(BufferedInputStream bis,
String[] subFileList,
String replace,
String string,
Map<String,String> fileData) |
static Object |
getAtomSetCollectionOrBufferedReaderFromZip(JmolAdapter adapter,
InputStream is,
String fileName,
String[] zipDirectory,
Map<String,Object> htParams,
boolean asBufferedReader)
A rather complicated means of reading a ZIP file, which could be a
single file, or it could be a manifest-organized file, or it could be
a Spartan directory.
|
static String |
getBinaryType(String name) |
static BufferedInputStream |
getBIS(byte[] bytes) |
static BufferedReader |
getBR(String string) |
static BufferedReader |
getBufferedReader(BufferedInputStream bis,
String charSet) |
static BufferedReader |
getBufferedReaderForResource(Viewer viewer,
Object resourceClass,
String classPath,
String resourceName) |
static byte[] |
getBytesFromSB(javajs.util.SB sb) |
static byte[] |
getCachedPngjBytes(FileManager fm,
String pathName) |
static int |
getCrcValue(byte[] bytes) |
static String |
getEmbeddedScript(String script) |
static void |
getFileReferences(String script,
javajs.util.List<String> fileList) |
private static JmolZipUtility |
getJzu() |
private static byte[] |
getMagic(InputStream is,
int n) |
static String |
getManifestScriptPath(String manifest)
check a JmolManifest for a reference to a script file (.spt)
|
static Object |
getStreamAsBytes(BufferedInputStream bis,
javajs.util.OC out) |
static byte[] |
getStreamBytes(InputStream is,
long n) |
static BufferedInputStream |
getUnzippedInputStream(BufferedInputStream bis) |
private static javajs.util.Encoding |
getUTFEncoding(byte[] bytes) |
private static javajs.util.Encoding |
getUTFEncodingForStream(BufferedInputStream is) |
static String[] |
getZipDirectoryAndClose(BufferedInputStream t,
boolean addManifest) |
static String |
getZipDirectoryAsStringAndClose(BufferedInputStream t) |
static Object |
getZipFileContents(BufferedInputStream bis,
String[] subFileList,
int listPtr,
boolean asBufferedInputStream) |
static Object |
getZipFileContentsAsBytes(BufferedInputStream bis,
String[] subFileList,
int i) |
static Object |
getZipOutputStream(Object bos) |
static String |
getZipRoot(String fileName) |
static boolean |
isBase64(javajs.util.SB sb) |
static boolean |
isCompoundDocumentB(byte[] bytes) |
static boolean |
isCompoundDocumentS(InputStream is) |
static boolean |
isGzipB(byte[] bytes) |
static boolean |
isGzipS(InputStream is) |
static boolean |
isPickleB(byte[] bytes) |
static boolean |
isPickleS(InputStream is) |
static boolean |
isPngZipStream(InputStream is) |
static boolean |
isZipB(byte[] bytes) |
static boolean |
isZipS(InputStream is) |
static InputStream |
newGZIPInputStream(BufferedInputStream bis) |
static javajs.api.ZInputStream |
newZipInputStream(InputStream in) |
static boolean |
readAll(BufferedReader br,
int nBytesMax,
boolean allowBinary,
String[] data,
int i) |
static String[] |
spartanFileList(String name,
String zipDirectory) |
static String |
StreamToString(BufferedInputStream bis) |
public static final String JPEG_CONTINUE_STRING
public static final String PMESH_BINARY_MAGIC_NUMBER
private static final String DELPHI_BINARY_MAGIC_NUMBER
static JmolZipUtility jzu
public static String determineSurfaceTypeIs(InputStream is)
public static String determineSurfaceFileType(BufferedReader bufferedReader)
private static javajs.util.Encoding getUTFEncodingForStream(BufferedInputStream is) throws IOException
IOException
public static String fixUTF(byte[] bytes)
private static javajs.util.Encoding getUTFEncoding(byte[] bytes)
private static byte[] getMagic(InputStream is, int n)
public static boolean isCompoundDocumentS(InputStream is)
public static boolean isCompoundDocumentB(byte[] bytes)
public static boolean isGzipS(InputStream is)
public static boolean isGzipB(byte[] bytes)
public static boolean isPickleS(InputStream is)
public static boolean isPickleB(byte[] bytes)
public static boolean isZipS(InputStream is)
public static boolean isZipB(byte[] bytes)
public static boolean isPngZipStream(InputStream is)
public static byte[] getStreamBytes(InputStream is, long n) throws IOException
IOException
private static JmolZipUtility getJzu()
public static String getZipDirectoryAsStringAndClose(BufferedInputStream t)
public static InputStream newGZIPInputStream(BufferedInputStream bis) throws IOException
IOException
public static javajs.api.ZInputStream newZipInputStream(InputStream in)
public static Object getZipFileContents(BufferedInputStream bis, String[] subFileList, int listPtr, boolean asBufferedInputStream)
public static String[] getZipDirectoryAndClose(BufferedInputStream t, boolean addManifest)
public static void getAllZipData(BufferedInputStream bis, String[] subFileList, String replace, String string, Map<String,String> fileData)
public static Object getZipFileContentsAsBytes(BufferedInputStream bis, String[] subFileList, int i)
public static Object getStreamAsBytes(BufferedInputStream bis, javajs.util.OC out) throws IOException
IOException
public static boolean isBase64(javajs.util.SB sb)
public static byte[] getBytesFromSB(javajs.util.SB sb)
public static BufferedInputStream getBIS(byte[] bytes)
public static BufferedReader getBR(String string)
public static byte[] getCachedPngjBytes(FileManager fm, String pathName)
public static boolean cachePngjFile(FileManager fm, String[] data)
public static Object getAtomSetCollectionOrBufferedReaderFromZip(JmolAdapter adapter, InputStream is, String fileName, String[] zipDirectory, Map<String,Object> htParams, boolean asBufferedReader)
adapter
- is
- fileName
- zipDirectory
- htParams
- asBufferedReader
- public static void getFileReferences(String script, javajs.util.List<String> fileList)
public static BufferedInputStream checkPngZipStream(BufferedInputStream bis)
bis
- public static BufferedReader getBufferedReader(BufferedInputStream bis, String charSet) throws IOException
bis
- charSet
- TODOIOException
public static String getManifestScriptPath(String manifest)
manifest
- public static boolean checkBinaryType(String fileTypeIn)
public static String StreamToString(BufferedInputStream bis)
public static boolean readAll(BufferedReader br, int nBytesMax, boolean allowBinary, String[] data, int i)
public static void addZipEntry(Object zos, String fileName) throws IOException
IOException
public static void closeZipEntry(Object zos) throws IOException
IOException
public static int getCrcValue(byte[] bytes)
public static BufferedReader getBufferedReaderForResource(Viewer viewer, Object resourceClass, String classPath, String resourceName) throws IOException
IOException
public static BufferedInputStream getUnzippedInputStream(BufferedInputStream bis) throws IOException
IOException