private boolean writePlane(int[] src, byte[] tmp, int width, int height) {
		try	{
			for (int y = 0; y < height; y++) 
			{
				for (int x = 0; x < width; x++) 
				{
					tmp[x] = (byte)src[y * width + x];
				}
				dos.write(tmp);
			}

			return true;
		}
		catch (Exception e)
		{
			e.printStackTrace();
			return false;
		}
	}