SHARE
TWEET

Untitled

a guest Jan 20th, 2012 181 Never
  1. //Scala Implicit for converting numbers to Little Endian
  2. class RAFImplicit(raf: RandomAccessFile){
  3.         def readShortLE() : Short  = java.lang.Short.reverseBytes(raf.readShort)
  4.         def readIntLE()   : Int    = java.lang.Integer.reverseBytes(raf.readInt)
  5.         def readLongLE()  : Long   = java.lang.Long.reverseBytes(raf.readLong)
  6.        
  7.         implicit def HEtoLE(ra: RandomAccessFile) = new RAFImplicit(raf)
  8. }
RAW Paste Data
Top