Skip to content

Instantly share code, notes, and snippets.

View liorboord's full-sized avatar

Lior Boord liorboord

View GitHub Profile
@liorboord
liorboord / gist:3675524
Created September 8, 2012 14:40
Jython - Convert File to Byte Array
from java.lang import Byte
from java.io import FileInputStream
from java.io import File
import jarray
def getByteArray(self,fileUrl):
file = File(fileUrl);
inputStream = FileInputStream(file)
length = file.length()
bytes = jarray.zeros(length, 'b')