     return @encodeArray bytes
 
   decompress: (string, map) ->
-    bytes = @decodeArray string
+    try
+      bytes = @decodeArray string
+    catch e
+      throw e
 
     bytesIndex    = 0
     blockPosition = 0

  # Compressor.BytesPerBlock
  encodeBlock: (block) ->
    bytes = new Array
    bytes.push (block.properties.topRotation    / 90) << 4 |
               (block.properties.middleRotation / 90) << 2 |
               (block.properties.lowRotation    / 90)

    bytes.push Compressor.CompressionTable[block.properties.top]    || 0x00
    bytes.push Compressor.CompressionTable[block.properties.middle] || 0x00
    bytes.push Compressor.CompressionTable[block.properties.low]    || 0x00

    return bytes

  decodeBlock: (bytes) ->
    properties = {}
    rotations  = bytes[0]

    properties.topRotation    = 90 * ((rotations & 0x30) >> 4)
    properties.middleRotation = 90 * ((rotations & 0x0C) >> 2)
    properties.lowRotation    = 90 *  (rotations & 0x03)

    for type, code of Compressor.CompressionTable
      properties.top    = type if code is bytes[1]
      properties.middle = type if code is bytes[2]
      properties.low    = type if code is bytes[3]

    return new Block properties

  # We encode 3 bytes as four characters
  encodeBytes: (bytes) ->
    return @encodeBits((bytes & 0xFC0000) >> 18) +
           @encodeBits((bytes & 0x03F000) >> 12) +
           @encodeBits((bytes & 0x000FC0) >>  6) +
           @encodeBits(bytes & 0x00003F)

  decodeBytes: (string) ->
    return (@decodeBits(string[0]) << 18) |
           (@decodeBits(string[1]) << 12) |
           (@decodeBits(string[2]) <<  6) |
            @decodeBits(string[3])

  #   Value Encoding  Value Encoding  Value Encoding  Value Encoding
  #       0 A            17 R            34 i            51 z

        index++
        continue

      try
        tmp = @decodeBytes string[index...index + 4]
      catch e
        throw e

      bytes.push (tmp & 0xFF0000) >> 16
      bytes.push (tmp & 0x00FF00) >>  8
