Skip to content

Commit 5820a2b

Browse files
hansonrhansonr
authored andcommitted
Allow JSUtil.getBytes to work on URL stream
1 parent 89084da commit 5820a2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sources/net.sf.j2s.java.core/src/swingjs/JSUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,11 +804,11 @@ public static Color getColorFromName(String c) {
804804

805805
/**
806806
*
807-
* @param f anything with 秘bytes (File, JSPath)
807+
* @param f anything with 秘bytes (File, JSPath) or URL._streamData
808808
* @return
809809
*/
810810
public static byte[] getBytes(Object f) {
811-
return ((File) f).秘bytes;
811+
return (f instanceof URL ? (byte[]) ((URL) f)._streamData : ((File) f).秘bytes);
812812
}
813813

814814
@Override

0 commit comments

Comments
 (0)